akhooli commited on
Commit
065c6ab
1 Parent(s): 3dfb63b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -4,13 +4,15 @@ from transformers import pipeline
4
 
5
  pipe = pipeline('text-generation', framework='pt', model='akhooli/ap2023', tokenizer='akhooli/ap2023')
6
  #gc.collect()
7
- samples = [['أنت'
8
- ,.96],['هل غادر'
 
9
  , 1.0],['ألا ليت'
10
- ,0.99],['يا قدس'
11
- , 0.98],['عيد بأية حال'
12
- ,0.94],['لكل شيء إذا ما'
13
- ,0.92],['.',0.99]]
 
14
  notes = """
15
  - Enter a short prompt or select (click) one of the examples and click SEND
16
  - Adjust parameters (temperture, top k, top p and penalty) through the slider (keep close to default values).
@@ -31,7 +33,7 @@ poetry = gr.Interface(fn=sayPoetry,
31
  gr.inputs.Slider(0.80, 1.0, step=0.01,default=0.95, label='control temperature'),
32
  gr.inputs.Slider(20, 100, step=1,default=50, label='control top k'),
33
  gr.inputs.Slider(0.80, 1.0, step=0.01,default=1.0, label='control top p'),
34
- gr.inputs.Slider(0.89, 1.0, step=0.01,default=1.20, label='control penalty'),
35
  ],
36
  outputs=[gr.outputs.Textbox(label="Generated Poetry:")],
37
 
 
4
 
5
  pipe = pipeline('text-generation', framework='pt', model='akhooli/ap2023', tokenizer='akhooli/ap2023')
6
  #gc.collect()
7
+ samples = [['أنت'],['هل غادر'],['ألا ليت'],['يا قدس'],['عيد بأية حال'],['لكل شيء إذا ما'],['.']]
8
+ #samples = [['أنت'
9
+ # ,.96],['هل غادر'
10
  , 1.0],['ألا ليت'
11
+ # ,0.99],['يا قدس'
12
+ # , 0.98],['عيد بأية حال'
13
+ # ,0.94],['لكل شيء إذا ما'
14
+ # ,0.92],['.',0.99]]
15
+
16
  notes = """
17
  - Enter a short prompt or select (click) one of the examples and click SEND
18
  - Adjust parameters (temperture, top k, top p and penalty) through the slider (keep close to default values).
 
33
  gr.inputs.Slider(0.80, 1.0, step=0.01,default=0.95, label='control temperature'),
34
  gr.inputs.Slider(20, 100, step=1,default=50, label='control top k'),
35
  gr.inputs.Slider(0.80, 1.0, step=0.01,default=1.0, label='control top p'),
36
+ gr.inputs.Slider(0.90, 1.20, step=0.01,default=1.20, label='control penalty'),
37
  ],
38
  outputs=[gr.outputs.Textbox(label="Generated Poetry:")],
39