Spaces:
Build error
Build error
Update main.py
Browse files35 unmodified lines363738393940414213 unmodified lines56575859596061625 unmodified lines686970717172737435 unmodified lines max_new_tokens: int = 2000 top_p: float = 0.95 repetition_penalty: float = 1.0 Async: bool = False asincrono: bool = False NumeroGenerazioni: int = 1 StringaSplit: str = '********' NumeroCaratteriSplitInstruction: int = 3000013 unmodified lines@app.post("/Genera")def generate_text(request: Request, input_data: InputData): LoggaTesto("INPUT", input_data.input) if not input_data.Async: if not input_data.asincrono: temperature = input_data.temperature max_new_tokens = input_data.max_new_tokens top_p = input_data.top_p5 unmodified lines LoggaTesto("RISPOSTA SINCRONA", generated_response) return {"response": generated_response} else: input_data.Async = false input_data.asincrono = False result_data = asyncio.run(GeneraTestoAsync("https://matteoscript-fastapi.hf.space/Genera", input_data)) LoggaTesto("RISPOSTA ASINCRONA FINALE", result_data) return {"response": result_data}main.py+3-3