Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -72,7 +72,7 @@ def generate_text(request: Request, input_data: InputData):
|
|
| 72 |
max_new_tokens = min(max_new_tokens, 29500 - len(input_text))
|
| 73 |
history = []
|
| 74 |
generated_response = generate(input_text, history, temperature, max_new_tokens, top_p, repetition_penalty)
|
| 75 |
-
generated_response = generated_response.replace('"', '')
|
| 76 |
LoggaTesto("RISPOSTA", {"response": generated_response})
|
| 77 |
return {"response": generated_response}
|
| 78 |
else:
|
|
@@ -82,7 +82,7 @@ def generate_text(request: Request, input_data: InputData):
|
|
| 82 |
input_data.input = input_data.input + msgEliminaRisposteNonPertinenti
|
| 83 |
input_data.systemRole = input_data.systemRole + msgEliminaRisposteNonPertinenti
|
| 84 |
result_data = asyncio.run(GeneraTestoAsync("https://matteoscript-fastapi.hf.space/Genera", input_data))
|
| 85 |
-
result_data = result_data.replace('"', '')
|
| 86 |
LoggaTesto("RISPOSTA ASINCRONA", {"response": result_data})
|
| 87 |
if input_data.EliminaRisposteNonPertinenti:
|
| 88 |
result_data = [item for item in result_data if "NOTFOUND" not in item["response"]]
|
|
@@ -92,7 +92,7 @@ def generate_text(request: Request, input_data: InputData):
|
|
| 92 |
input_data.systemStyle = 'Rispondi in ITALIANO'
|
| 93 |
input_data.instruction =''
|
| 94 |
result_data = asyncio.run(GeneraTestoAsync("https://matteoscript-fastapi.hf.space/Genera", input_data))
|
| 95 |
-
result_data = result_data.replace('"', '')
|
| 96 |
LoggaTesto("RISPOSTA ASINCRONA UNIFICATA", {"response": result_data})
|
| 97 |
return {"response": result_data}
|
| 98 |
|
|
|
|
| 72 |
max_new_tokens = min(max_new_tokens, 29500 - len(input_text))
|
| 73 |
history = []
|
| 74 |
generated_response = generate(input_text, history, temperature, max_new_tokens, top_p, repetition_penalty)
|
| 75 |
+
#generated_response = generated_response.replace('"', '')
|
| 76 |
LoggaTesto("RISPOSTA", {"response": generated_response})
|
| 77 |
return {"response": generated_response}
|
| 78 |
else:
|
|
|
|
| 82 |
input_data.input = input_data.input + msgEliminaRisposteNonPertinenti
|
| 83 |
input_data.systemRole = input_data.systemRole + msgEliminaRisposteNonPertinenti
|
| 84 |
result_data = asyncio.run(GeneraTestoAsync("https://matteoscript-fastapi.hf.space/Genera", input_data))
|
| 85 |
+
#result_data = result_data.replace('"', '')
|
| 86 |
LoggaTesto("RISPOSTA ASINCRONA", {"response": result_data})
|
| 87 |
if input_data.EliminaRisposteNonPertinenti:
|
| 88 |
result_data = [item for item in result_data if "NOTFOUND" not in item["response"]]
|
|
|
|
| 92 |
input_data.systemStyle = 'Rispondi in ITALIANO'
|
| 93 |
input_data.instruction =''
|
| 94 |
result_data = asyncio.run(GeneraTestoAsync("https://matteoscript-fastapi.hf.space/Genera", input_data))
|
| 95 |
+
#result_data = result_data.replace('"', '')
|
| 96 |
LoggaTesto("RISPOSTA ASINCRONA UNIFICATA", {"response": result_data})
|
| 97 |
return {"response": result_data}
|
| 98 |
|