Spaces:
Build error
Build error
Update main.py
Browse files41 unmodified lines42434445464724 unmodified lines7273747576777816 unmodified lines959697989910010141 unmodified linesNumeroCaratteriSplitInstruction: int = 30000EliminaRisposteNonPertinenti: bool = FalseUnificaRispostaPertinente: bool = Falseclass InputDataAsync(InputData):test: str = ''24 unmodified linesmax_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)#generated_response = generated_response.replace('"', '')LoggaTesto("RISPOSTA", {"response": generated_response})return {"response": generated_response}else:16 unmodified lines#result_data = result_data.replace('"', '')LoggaTesto("RISPOSTA ASINCRONA UNIFICATA", {"response": result_data})return {"response": result_data}def generate_input_text(input_data):if input_data.instruction.startswith("http"):try:41 unmodified lines42434445464748495024 unmodified lines757677787980818216 unmodified lines9910010110210310410510610710810911011111211311411541 unmodified linesNumeroCaratteriSplitInstruction: int = 30000EliminaRisposteNonPertinenti: bool = FalseUnificaRispostaPertinente: bool = FalsetelegramChatId: str = ''telegramUrlBot: str = ''telegramUrlPost: str = ''class InputDataAsync(InputData):test: str = ''24 unmodified linesmax_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)if input_data.telegramChatId != '' && input_data.telegramUrlBot != '' && input_data.telegramUrlPost != '':call_telegram_api(input_data, generated_response)LoggaTesto("RISPOSTA", {"response": generated_response})return {"response": generated_response}else:16 unmodified lines#result_data = result_data.replace('"', '')LoggaTesto("RISPOSTA ASINCRONA UNIFICATA", {"response": result_data})return {"response": result_data}def call_telegram_api(input_data, generated_response):payload = {"chat_id": input_data.telegramChatId,"text": generated_response","telegramUrl": input_data.telegramUrlBot}response = requests.post(input_data.telegramUrlPost, json=payload)if response.status_code != 200:print("Errore nella richiesta POST. Codice di stato:", response.status_code)def generate_input_text(input_data):if input_data.instruction.startswith("http"):try:
main.py+16-2