akhooli commited on
Commit
7ede5d0
1 Parent(s): 175954c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -4,13 +4,20 @@ from transformers import pipeline
4
 
5
  pipe = pipeline('text-generation', framework='pt', model='akhooli/ap2023', tokenizer='akhooli/ap2023')
6
  #gc.collect()
7
- samples = [['أنت'],['لولا كتاب'],['ألا ليت'],['يا قدس'],['عيد بأية حال'],['لكل شيء إذا ما'],['.']]
 
 
 
 
 
 
8
  notes = """
9
  - Enter a short prompt or select (click) one of the examples
10
- - Control temperture (adjust) through slider (0.95 for examples). Higher usually better.
11
  - Clear and enter new prompt or select another example to regenerate
12
  - The '.' means start a new line (your prompt need not be long)
13
- - be patient: this runs on CPU (free tier)
 
14
  """
15
  def sayPoetry(prompt, temp=0.95):
16
  gen = pipe(prompt, max_length=96, temperature = temp)[0]["generated_text"]
 
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
16
+ - Control temperture (adjust) through slider (Higher usually better).
17
  - Clear and enter new prompt or select another example to regenerate
18
  - The '.' means start a new line (your prompt need not be long)
19
+ - Be patient: this runs on CPU (free tier)
20
+ - Feedback (Twitter): @akhooli
21
  """
22
  def sayPoetry(prompt, temp=0.95):
23
  gen = pipe(prompt, max_length=96, temperature = temp)[0]["generated_text"]