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 MMLU score
- Fix Jailbreak detection tutorial variable name HOT 1
- Support for LLMs hosted on AWS Bedrock HOT 2
- Fresh venv install following the Quickstart example fails due to ModuleNotFoundError: No module named 'fsspec' HOT 1
- New Project missing .jsonl file will not indicate it as a required file on Safari HOT 1
- Creating a New Project with a bad key results in null values HOT 1
- No warning when creating a New Project with the same name HOT 4
- Mamba Integration
- 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 5
- llama.cpp local eval support
- docker image to multi architecture HOT 2
- Issue Creating new project
- Use Local LLM 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.