update
Browse files
app.py
CHANGED
@@ -20,6 +20,7 @@ os.environ['HF_HOME'] = '/app/.cache'
|
|
20 |
# model = T5ForConditionalGeneration.from_pretrained(model_name)
|
21 |
# model = AutoModelForCausalLM.from_pretrained("THUDM/longwriter-glm4-9b", trust_remote_code=True)
|
22 |
# tokenizer = AutoTokenizer.from_pretrained("THUDM/longwriter-glm4-9b", trust_remote_code=True)
|
|
|
23 |
|
24 |
# Configuration du client OpenAI avec l'API NVIDIA
|
25 |
client = OpenAI(
|
@@ -98,8 +99,8 @@ async def generate_text(request: RequestModel):
|
|
98 |
model="meta/llama-3.1-8b-instruct",
|
99 |
messages=[{"role": "user", "content": instructions_par_defaut + request.text}],
|
100 |
temperature=0.2,
|
101 |
-
top_p=0.
|
102 |
-
max_tokens=1024,
|
103 |
stream=True
|
104 |
)
|
105 |
# response = ollama.chat(
|
|
|
20 |
# model = T5ForConditionalGeneration.from_pretrained(model_name)
|
21 |
# model = AutoModelForCausalLM.from_pretrained("THUDM/longwriter-glm4-9b", trust_remote_code=True)
|
22 |
# tokenizer = AutoTokenizer.from_pretrained("THUDM/longwriter-glm4-9b", trust_remote_code=True)
|
23 |
+
prompt_first ="Résumé en 4 ou 5 phrases de la plainte suivante :"
|
24 |
|
25 |
# Configuration du client OpenAI avec l'API NVIDIA
|
26 |
client = OpenAI(
|
|
|
99 |
model="meta/llama-3.1-8b-instruct",
|
100 |
messages=[{"role": "user", "content": instructions_par_defaut + request.text}],
|
101 |
temperature=0.2,
|
102 |
+
top_p=0.9,
|
103 |
+
# max_tokens=1024,
|
104 |
stream=True
|
105 |
)
|
106 |
# response = ollama.chat(
|