Comments (2)
@ashish-1600 Thanks, that was the issue indeed.
from uptrain.
Hi @HasnainKhanNiazi ,
Thanks for raising this issue.
I have figured out a way to get this working in your use-case.
I am using uvicorn as my ASGI web server framework. In uvicorn, we have to set the event loop as 'asyncio'.
I am attaching the code for your reference.
@app.get("/")
async def read_root():
return {"message": "Welcome to the LLM Evaluation API"}
@app.post("/evaluate/hallucination", response_model=EvaluationResponse)
async def hallucination_detect():
try:
data = [
{
"question": "Hello",
"context": "Hello",
"response": "Hello",
}
]
result = eval_llm.evaluate(
data=data,
checks=[Evals.FACTUAL_ACCURACY],
)
print(result)
return EvaluationResponse(result=result)
except Exception as e:
return EvaluationResponse(result={}, error=str(e))
if __name__ == "__main__":
uvicorn.run("app:app", host="0.0.0.0", port=4300, loop='asyncio')
You don't have to make any changes in the EvalLLM. Let me know if it works for you. :)
from uptrain.
Related Issues (20)
- Add an operator to compute MT-Bench
- Too many values to unpack (resp_text.split) HOT 3
- Update the Integrations table in README.md HOT 1
- Support for LLMs running on Vertex AI HOT 1
- gpt-4-turbo-preview support not available in OpenAI models HOT 12
- Return tokens count/cost for checks HOT 1
- Azure LLM evaluation - Deployment Error HOT 6
- llama.cpp local eval support
- docker image to multi architecture HOT 2
- Issue Creating new project HOT 2
- Use Local LLM HOT 1
- Support to use locally hosted HuggingFace LLMs as an evaluator
- Custom Prompts -Example clarification HOT 1
- Event loop is closed when running factual accuracy evaluations HOT 1
- Error when sending request to LLM API: Task got bad yield: WaitTaskRescheduled(abort_func=<function sleep_forever.<locals>.<lambda> at 0x1413db380>)
- Extend Visualization Module to Support Bubble, Violin, and Box Plots
- Response Matching requires context field because the field gets dropped by polars HOT 1
- Error when processing payload
- Error when parsing JSON: Empty strings are not legal JSON5 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uptrain.