Spaces:
Sleeping
Sleeping
app.py
CHANGED
@@ -52,7 +52,7 @@ def get_completion(msg):
|
|
52 |
|
53 |
with torch.no_grad():
|
54 |
outputs = peft_model.generate(
|
55 |
-
**inputs, max_new_tokens=
|
56 |
)
|
57 |
|
58 |
#peft_model.to(cpu_device)
|
@@ -75,5 +75,5 @@ def greet(input):
|
|
75 |
###return json.dumps(extract_json(gen_text, -1))
|
76 |
return response
|
77 |
|
78 |
-
demo = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Elevator pitcher", lines=
|
79 |
demo.launch()
|
|
|
52 |
|
53 |
with torch.no_grad():
|
54 |
outputs = peft_model.generate(
|
55 |
+
**inputs, max_new_tokens=512, pad_token_id = tokenizer.eos_token_id
|
56 |
)
|
57 |
|
58 |
#peft_model.to(cpu_device)
|
|
|
75 |
###return json.dumps(extract_json(gen_text, -1))
|
76 |
return response
|
77 |
|
78 |
+
demo = gr.Interface(fn=greet, inputs=[gr.Textbox(label="Elevator pitcher", lines=1)], outputs=gr.Text())
|
79 |
demo.launch()
|