Spaces:
Runtime error
Runtime error
dorogan commited on
Commit ·
c4dc20f
1
Parent(s): 676808b
Update: async methods were added to api
Browse files3 unmodified lines456789103 unmodified lines14151617181920213 unmodified linesfrom model import get_answer_from_llmclass Prompt(BaseModel):prompt: str = ''3 unmodified lines@app.post("/completion/")def get_answer(question: Prompt.prompt):answer = get_answer_from_llm(question)return answer3 unmodified lines456789103 unmodified lines14151617181920213 unmodified linesfrom model import get_answer_from_llmclass PromptType(BaseModel):prompt: str = ''3 unmodified lines@app.post("/completion/")async def get_answer(question: PromptType = None):answer = await get_answer_from_llm(question=question.prompt)return answer
23 unmodified lines242526272823 unmodified linestemperature=0.3,)gen_text = await tokenizer.decode(gen_tokens[0])return gen_text23 unmodified lines242526272823 unmodified linestemperature=0.3,)gen_text = tokenizer.decode(gen_tokens[0])return gen_text
app.py+3-3
model.py+1-1