akhooli commited on
Commit
8600b72
1 Parent(s): e2ab242

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
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
- ,None, None, None, None],['هل غادر'
9
- ,None, None, None, None ],['ألا ليت'
10
- ,None, None, None, None ],['يا قدس'
11
- ,None, None, None, None],['عيد بأية حال'
12
- ,None, None, None, None],['لكل شيء إذا ما'
13
- ,None, None, None, None ],['.'
14
- ,None, None, None, None]]
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,default=1.0, label='control temperature'),
42
- gr.Slider(25, 100, step=1,default=50, label='control top k'),
43
- gr.Slider(0.80, 1.0, step=0.01,default=1.0, label='control top p'),
44
- gr.Slider(0.90, 1.20, step=0.01,default=1.0, label='control penalty'),
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