Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,8 +17,8 @@ proc_tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-4k-instruct
|
|
17 |
|
18 |
proc_pipe = pipeline(
|
19 |
"text-generation",
|
20 |
-
model=
|
21 |
-
tokenizer=
|
22 |
)
|
23 |
|
24 |
generation_args = {
|
@@ -28,12 +28,16 @@ generation_args = {
|
|
28 |
"do_sample": False,
|
29 |
}
|
30 |
|
|
|
|
|
|
|
|
|
31 |
|
32 |
|
33 |
# Create a Gradio interface
|
34 |
iface = gr.Interface(
|
35 |
-
fn=
|
36 |
-
inputs=[gr.Textbox(lines=5, placeholder="Enter your prompt here...")
|
37 |
outputs=gr.Textbox()
|
38 |
)
|
39 |
|
|
|
17 |
|
18 |
proc_pipe = pipeline(
|
19 |
"text-generation",
|
20 |
+
model=proc_model,
|
21 |
+
tokenizer=proc_tokenizer,
|
22 |
)
|
23 |
|
24 |
generation_args = {
|
|
|
28 |
"do_sample": False,
|
29 |
}
|
30 |
|
31 |
+
def generate_response(inputs):
|
32 |
+
output = proc_pipe(inputs, **generation_args)
|
33 |
+
return output[0]['generated_text']
|
34 |
+
|
35 |
|
36 |
|
37 |
# Create a Gradio interface
|
38 |
iface = gr.Interface(
|
39 |
+
fn=generate_response,
|
40 |
+
inputs=[gr.Textbox(lines=5, placeholder="Enter your prompt here...")]
|
41 |
outputs=gr.Textbox()
|
42 |
)
|
43 |
|