Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,13 +5,13 @@ from transformers import pipeline
|
|
5 |
pipe = pipeline('text-generation', framework='pt', model='akhooli/ap2023', tokenizer='akhooli/ap2023')
|
6 |
#gc.collect()
|
7 |
samples = [['أنت'
|
8 |
-
,
|
9 |
-
,
|
10 |
-
,
|
11 |
-
,
|
12 |
-
,
|
13 |
-
,
|
14 |
-
,
|
15 |
#samples = [['أنت'
|
16 |
# ,.96],['هل غادر'
|
17 |
# , 1.0],['ألا ليت'
|
@@ -38,10 +38,10 @@ def sayPoetry(prompt, temp=1.0, topk = 50, topp = 1.0, penalty=1.0):
|
|
38 |
poetry = gr.Interface(fn=sayPoetry,
|
39 |
inputs=[
|
40 |
gr.Textbox(label="Enter short prompt or select from examples:"),
|
41 |
-
gr.Slider(0.80, 1.0, step=0.01,
|
42 |
-
gr.Slider(25, 100, step=1,
|
43 |
-
gr.Slider(0.80, 1.0, step=0.01,
|
44 |
-
gr.Slider(0.90, 1.20, step=0.01,
|
45 |
],
|
46 |
outputs=[gr.Textbox(label="Generated Poetry:")],
|
47 |
|
|
|
5 |
pipe = pipeline('text-generation', framework='pt', model='akhooli/ap2023', tokenizer='akhooli/ap2023')
|
6 |
#gc.collect()
|
7 |
samples = [['أنت'
|
8 |
+
,1.0, 50, 1.0, 1.0],['هل غادر'
|
9 |
+
,1.0, 50, 1.0, 1.0 ],['ألا ليت'
|
10 |
+
,1.0, 50, 1.0, 1.0 ],['يا قدس'
|
11 |
+
,1.0, 50, 1.0, 1.0],['عيد بأية حال'
|
12 |
+
,1.0, 50, 1.0, 1.0],['لكل شيء إذا ما'
|
13 |
+
,1.0, 50, 1.0, 1.0 ],['.'
|
14 |
+
,1.0, 50, 1.0, 1.0]]
|
15 |
#samples = [['أنت'
|
16 |
# ,.96],['هل غادر'
|
17 |
# , 1.0],['ألا ليت'
|
|
|
38 |
poetry = gr.Interface(fn=sayPoetry,
|
39 |
inputs=[
|
40 |
gr.Textbox(label="Enter short prompt or select from examples:"),
|
41 |
+
gr.Slider(0.80, 1.0, step=0.01,value=1.0, label='control temperature'),
|
42 |
+
gr.Slider(25, 100, step=1,value=50, label='control top k'),
|
43 |
+
gr.Slider(0.80, 1.0, step=0.01,value=1.0, label='control top p'),
|
44 |
+
gr.Slider(0.90, 1.20, step=0.01,value=1.0, label='control penalty'),
|
45 |
],
|
46 |
outputs=[gr.Textbox(label="Generated Poetry:")],
|
47 |
|