Spaces:
Runtime error
Runtime error
Upload ui.py
Browse files
ui.py
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from model import ModelServe
|
3 |
+
|
4 |
+
model = ModelServe(load_8bit=False)
|
5 |
+
demo = gr.Interface(
|
6 |
+
fn=model.generate,
|
7 |
+
inputs=[
|
8 |
+
gr.components.Textbox(
|
9 |
+
lines=2, label="Instruction", placeholder="Tell me about alpacas."
|
10 |
+
),
|
11 |
+
gr.components.Textbox(lines=2, label="Input", placeholder="none"),
|
12 |
+
gr.components.Slider(minimum=0, maximum=1, value=0.1, label="Temperature"),
|
13 |
+
gr.components.Slider(minimum=0, maximum=1, value=0.75, label="Top p"),
|
14 |
+
gr.components.Slider(
|
15 |
+
minimum=0, maximum=100, step=1, value=40, label="Top k"
|
16 |
+
),
|
17 |
+
gr.components.Slider(minimum=1, maximum=4, step=1, value=4, label="Beams"),
|
18 |
+
gr.components.Slider(
|
19 |
+
minimum=1, maximum=2000, step=1, value=128, label="Max tokens"
|
20 |
+
),
|
21 |
+
],
|
22 |
+
outputs=[
|
23 |
+
gr.Textbox(
|
24 |
+
lines=5,
|
25 |
+
label="Output",
|
26 |
+
)
|
27 |
+
],
|
28 |
+
title="π¦π² Alpaca-7B-Chinese",
|
29 |
+
description="Alpaca-7B-Chinese is a 7B-parameter LLaMA model finetuned to follow instructions.",
|
30 |
+
)
|
31 |
+
#demo.queue(concurrency_count=3)
|
32 |
+
demo.queue()
|
33 |
+
demo.launch(share=True, server_name="120.125.77.111")
|