Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -42,8 +42,32 @@ def generate_code(prompt):
|
|
42 |
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
43 |
return response
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
43 |
return response
|
44 |
|
45 |
+
with gr.Blocks(title="Qwen 14b") as demo: # Updated title
|
46 |
+
with gr.Tab("Code Chat"):
|
47 |
+
run_button = gr.Button("Run", scale=0)
|
48 |
+
prompt = gr.Text(
|
49 |
+
label="Prompt",
|
50 |
+
show_label=False,
|
51 |
+
max_lines=1,
|
52 |
+
placeholder="Enter your prompt",
|
53 |
+
container=False,
|
54 |
+
)
|
55 |
+
result = gr.Text(
|
56 |
+
label="Result",
|
57 |
+
show_label=False,
|
58 |
+
max_lines=100,
|
59 |
+
container=False,
|
60 |
+
)
|
61 |
+
gr.on(
|
62 |
+
triggers=[
|
63 |
+
run_button_30.click,
|
64 |
+
],
|
65 |
+
# api_name="generate", # Add this line
|
66 |
+
fn=generate_30,
|
67 |
+
inputs=[
|
68 |
+
prompt,
|
69 |
+
],
|
70 |
+
outputs=[result],
|
71 |
+
)
|
72 |
+
|
73 |
+
demo.launch(share=False)
|