Spaces:
Runtime error
Runtime error
Download main.py from JR818/JarvisFastAPI: direct link, hf CLI and curl.
- Browser
- Download file 574 Bytes
-
https://huggingface.co/spaces/JR818/JarvisFastAPI/resolve/e9fffa81c981f9eddbbc7065d231ffc8ee7fb485/main.py
- Command line
-
hf download hf://spaces/JR818/JarvisFastAPI@e9fffa81c981f9eddbbc7065d231ffc8ee7fb485/main.py
-
curl -L -o main.py https://huggingface.co/spaces/JR818/JarvisFastAPI/resolve/e9fffa81c981f9eddbbc7065d231ffc8ee7fb485/main.py
574 Bytes
| import time | |
| from fastapi import FastAPI | |
| from service.vector_store import vector_store | |
| from pydantic import BaseModel | |
| from fastapi.responses import StreamingResponse | |
| from service.api import api | |
| app = FastAPI() | |
| def read_root(): | |
| return {"Hello": "World!"} | |
| def search(inputs: str): | |
| return vector_store.search(inputs) | |
| def get_suggestion(inputs: str): | |
| return api.get_suggestion(inputs) | |
| async def get_answer(inputs: str): | |
| return StreamingResponse(api.get_answer(inputs)) |