Update app.py
Browse files
app.py
CHANGED
@@ -62,11 +62,8 @@ def generate_response(prompt: str) -> dict:
|
|
62 |
repetition_penalty=1.1
|
63 |
)
|
64 |
# Generate the response
|
65 |
-
|
66 |
|
67 |
-
input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
|
68 |
-
output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
|
69 |
-
generated_response = (tokenizer.decode(output[0]))
|
70 |
# Extract the assistant's reply
|
71 |
assistant_reply = generated_response.split('\n')[1]
|
72 |
|
|
|
62 |
repetition_penalty=1.1
|
63 |
)
|
64 |
# Generate the response
|
65 |
+
generated_response = pipe(prompt_template)[0]['generated_text']
|
66 |
|
|
|
|
|
|
|
67 |
# Extract the assistant's reply
|
68 |
assistant_reply = generated_response.split('\n')[1]
|
69 |
|