Spaces:
Runtime error
Runtime error
Update main.py
Browse files66 unmodified lines676869707071727374747576772 unmodified lines80818283838485862 unmodified lines8990919293949566 unmodified lines top_p = input_data.top_p repetition_penalty = input_data.repetition_penalty input_text = generate_input_text(input_data) LoggaTesto("RICHIESTA SINCRONA", input_text, False) LoggaTesto("RICHIESTA", input_text, False) max_new_tokens = min(max_new_tokens, 29500 - len(input_text)) history = [] generated_response = generate(input_text, history, temperature, max_new_tokens, top_p, repetition_penalty) LoggaTesto("RISPOSTA SINCRONA", {"response": generated_response}) LoggaTesto("RISPOSTA", {"response": generated_response}) return {"response": generated_response} else: input_data.asincrono = False2 unmodified lines input_data.input = input_data.input + msgEliminaRisposteNonPertinenti input_data.systemRole = input_data.systemRole + msgEliminaRisposteNonPertinenti result_data = asyncio.run(GeneraTestoAsync("https://matteoscript-fastapi.hf.space/Genera", input_data)) LoggaTesto("RISPOSTA ASINCRONA FINALE", {"response": result_data}) LoggaTesto("RISPOSTA ASINCRONA", {"response": result_data}) if input_data.EliminaRisposteNonPertinenti: result_data = [item for item in result_data if "NOTFOUND" not in item["response"]] if input_data.UnificaRispostaPertinente:2 unmodified lines input_data.systemStyle = 'Rispondi in ITALIANO' input_data.instruction ='' result_data = asyncio.run(GeneraTestoAsync("https://matteoscript-fastapi.hf.space/Genera", input_data)) LoggaTesto("RISPOSTA ASINCRONA UNIFICATA", {"response": result_data}) return {"response": result_data} def generate_input_text(input_data):main.py+4-3