Practical tips to streamline your LLM testing workflow using the #Pytest framework 🐍 https://lnkd.in/gr-MuhT3 #LLMs #LLMOps
Log10.io’s Post
More Relevant Posts
-
CI/CD is crucial in today's tech landscape. However, diving into it can be challenging. This article sheds light on the importance and implementation of CI/CD, especially for Data Engineering in Python. 🔍 Key Takeaways: 1. DevOps in Data Engineering: While large organizations benefit from specialized DevOps teams, smaller ones require skills across the entire stack. This makes some software engineers less adept at transitioning code to production. 2. Unit Tests: These test individual functionalities. For instance, a function that processes data should be tested with a dataset to ensure it works as expected. 3. Integration Tests: These tests focus on the connection between your application and third-party APIs, ensuring that data integrations work seamlessly. 4. Fast API: It's essential to test endpoints used in Fast API when setting up an App Service. 5. Linting: Linting tools, like Pylint in VS Code, help identify programming errors and stylistic issues, ensuring code quality. 6. CI/CD Process: The ideal process involves writing code, testing and linting it locally, and then pushing it to a branch. Before merging, the code should be built in a staging environment to ensure compatibility. For a deeper dive and practical tips on setting up CI/CD for Data Engineering, check out the full article by Serop B.: https://lnkd.in/dG4u7B-E Image credits: Python-Development-and-CICD-1024x576.png #Python #CICD
To view or add a comment, sign in
-
-
Software Engineer & MLOPs | Computer Engineer (distinction with honors) | Computer Engineering TA at faculty of engineering in cairo | Udacity Tutor | Senior Python Backend Developer
don't use exec() this is what happens when an MLOPS starts productionizing machine learning code, see the word `exec()` in the code. here are a number of reasons why you shouldn't use exec() 1. **Security Risks:** The use of the `exec` function in Python introduces significant security risks, particularly when handling untrusted or user-generated input. The execution of arbitrary code raises concerns about potential malicious code injection, posing a direct threat to the program's security. 2. **Obfuscation Challenges:** Code obfuscation tools encounter difficulties when applied to code containing `exec`. Dynamically generated code tends to be intricate and resistant to traditional obfuscation techniques, making it challenging to obscure the program's logic effectively. 3. **Debugging Complexity:** Debugging becomes a formidable task in the presence of `exec`. Traditional debugging tools may struggle to trace the execution flow through dynamically generated code, impeding issue identification and resolution. This lack of transparency complicates the development and troubleshooting processes. 4. **Readability and Maintenance Concerns:** The use of `exec` compromises code readability, a fundamental principle in Python's design philosophy. The non-linear structures introduced by dynamically generated code make the program harder to read, impacting collaboration and the long-term maintainability of the codebase.
To view or add a comment, sign in
-
-
LangChain JS Arbitrary File Read Vulnerability LangChain is an open-source framework designed to assist the development of applications powered by large language models (LLMs). This project has more than 11,000 stars and more than 380,000 weekly downloads . This vulnerability allows an attacker to read files on the server. #aisecacademy,#aivulnerabilities
LangChain JS Arbitrary File Read Vulnerability
evren.ninja
To view or add a comment, sign in
-
AI & Big Data platform Strategist | Gen AI | Big Data | Machine Learning | Cloud | Scala | Python | Product Development | Leadership | Mentoring | Thought Leader
The problem is that code coverage is not a quality metric. It can give a false sense of security. High coverage percentages don't necessarily mean the code is well-tested or free of bugs. It simply indicates that a certain percentage of the code has been executed during testing, not that the tests are thorough or cover all relevant use cases and potential error conditions. The alternate or complemenary solutions can be - 1. Mutation Testing: https://lnkd.in/gRbSM5Pu Mutation Testing is about creating modified versions of the source code, called mutants, and then seeing if the tests are able to detect them. You make a small change, you run all your tests, then you check 2. Hypothesis Testing in Python: https://lnkd.in/g6YfyJHw It works by letting you write tests that assert that something should be true for every case, not just the ones you happen to think of, and I am leveraging it in my current project. 3. Property based tests in Scala: https://lnkd.in/g7mgvwEx I have used it a few years back. One need to think differently and learn to reason about the code. Please share your experience with these tools. #pythonprogramming #testdrivendevelopment #scala #hypothesistesting #propertbasedtesting #pyspark #bigdata
Forget code coverage. Use Mutation Testing
craftbettersoftware.com
To view or add a comment, sign in
-
Lately I have started a personal project, a little bot written in Python and I decided to make it public. While I'm not a Python Guru, not even an expert, I'm inviting you all who have knowledge, desire or curiosity to have a look at it and maybe share some ideas. It's far from being complete, and more info about the project is in its README page. https://lnkd.in/dbtrid_3
GitHub - nazguul512/xtb_trading_bot
github.com
To view or add a comment, sign in
-
If you're into #pythonprogramming and are interested in greater QA and testing, I've completed my first in a series of planned blogs called 'pytest in plain English'. The first one is on the use of fixtures #Python #coding #Software #SoftwareDeveloper : https://lnkd.in/eKjtQn5m #datascience
The Data Savvy Corner - Pytest Fixtures in Plain English
thedatasavvycorner.com
To view or add a comment, sign in
-
This weekend I did something pretty cool. I published a package to PyPi, so now my code may be pip install'ed by anyone anywhere in the world. The 'interesting' package is used to analyse Fixed Income bonds and portfolios, really anything around 'interest' rates. It answers analysis and valuation questions I would otherwise answer with Excel. I've written this package in my spare time powered by ChatGPT. This experience taught me a lot about LLM-Human pair-programming. The key lesson was that LLMs speed up development tremendously, if they don't set you on the wrong course. I've tried a few other 'new' things (e.g. Codespace, Ruff, PDM, etc). These are reusable in Python / DevOps / MLOps projects, and I will share my thoughts in another post. If anyone is interested in collaborating, just reach out. There's a lot to be done. For now, let me present, interesting. #interest #fixedincome #pypi #portfolioanalysis #valuation #python #ruff #pytest #pdm #github #codespace #chatgpt #excel #finance #llm #devops #ops #mlops https://lnkd.in/e-hKG6rp
interesting
pypi.org
To view or add a comment, sign in
-
Here is a recent blogpost showing off containerlabs and a very basic CI/CD pipeline for testing networks: https://lnkd.in/gea6Jpms I don't go into the various testing frameworks, what language or package/module is better, but we get a basic workflow running to build a topology and perform the most basic test using Python + Pytest. I've been using containerlab for my studies for the past year(ish) and it's such a fantastic tool when you build your docker images, push them into a private registry so you can pull them down on any machine running containerlab. This same scenario is demonstrated to speed up the CI/CD process so we don't have to build the image (Cisco XRd in my example) every time we deploy a new topology. I plan on going into a bit more detail in another blog post using PyATS to build the test network, and then releasing a public tool to generate PyATS topology files from a given containerlab topology-data.json that is automatically generated when deploying a lab.
Using Containerlabs with CI/CD
bspendlove.github.io
To view or add a comment, sign in
-
Data people, Pep8 says to use 4 spaces to indent, not tab. That's probably why your code fails when you run it in a code analyzer like Pylint. Don't worry though, we all do it. Jupyter Notebook uses tab for indentation, but that's not exactly best coding practice. In fact, this is why you get annoying arrows if you copy your code from your Jupyter notebook to any other popular IDE like Sublime or Visual Code. Those other IDEs all use spaces. Now, you can change the indentation rules of your Jupyter Notebooks to be two spaces, but let's face it, we Data people like our Python to come in chunks like R and use tabs for indentations like SQL. It's the way it's always going to be. It's prettier that way. Just wanted to let you know the right way so we can continue to do it the nicer looking yet technically incorrect way without being confused by the error messages. The more ya know. #ai
To view or add a comment, sign in
-
Hello connection Here I have completed day 22 of the Hacker Rank challenge in problem solving #codingchallenge #problemsolving #HackerRankchalleng Syad Ayaz Ali problem 1:-Counting sort 2 code logic:-The countingSort function takes a vector of integers arr as input and eturn a sorted version of that vector. Inside countingSort, it initializes two vectors: result and count The count vector is initialized with 100 elements, all set to 0, assum that the input integers in arr be in the range from 0 to 90. After counting the occurrence of each integer, the code proceeds to construct the sorted result vector. It iterates through the count vector and for each countoccurrences of the integer i to the result finally the sorted result vector is returned. problem 2:-Gemstones code logic:-The gemstones function takes a vector of strings arr as input. Inside the gemstones function, it initializes a vector alpha of size 26 with all elements initially set to 0. This vector It initializes a variable count to 0, which will be used to count the number of gemstones.it iterates through its characters. For each character, it checks if the character is present in the current mineral composition (i.e., alpha[int(arr[i][j]) - 97] == i). If it is, it increments the count for that character in the vector. Finally, the count variable is returned as the result. problem 3:-Alternating character code logic:-The alternatingCharacters function takes a string s as input and returns an integer representing the number of deletions required to make the string contain only alternating characters. Inside the alternatingCharacters function, it initializes an integer variable res to 0. This variable will be used to count the number of deletions required. The code then iterates through the characters in the input string s, starting from the second character (index 1). For each character s[i], it checks if it is equal to the previous character s[i-1]. If they are the same, it means there are consecutive characters that are equal, so it increments the res variable to indicate that a deletion is required to maintain alternating character problem 4:-Beautiful Binary code logic:-he beautifulBinaryString function takes a binary string b as input and returns an integer representing the minimum number of replacements needed to make it beautiful. Inside the beautifulBinaryString function, it initializes an integer variable cnt to 0. This variable will be used to count the number of replacements required. The code then iterates through the binary string from the beginning to the third-to-last character. For each position i, it checks if the current character b[i], the next character b[i + 1], and the character after that b[i + 2] form the 010 substring. If they do, it means that a replacement is needed to make the string beautiful. Therefore, it increments the cnt variable by 1 and jumps two characters ahead. code perform image:-
To view or add a comment, sign in
-