akhooli commited on
Commit
ea85ffc
1 Parent(s): 90be0ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -4,13 +4,13 @@ from transformers import pipeline
4
 
5
  pipe = pipeline('text-generation', framework='pt', model='akhooli/ap2023', tokenizer='akhooli/ap2023')
6
  #gc.collect()
7
- samples = [['أنت', 0.95],['لولا كتاب'],['ألا ليت'],['يا قدس'],['عيد بأية حال'],['لكل شيء إذا ما'],['.']]
8
  notes = """
9
  - Enter a short prompt or select one of the examples
10
  - generate poetry
11
  - be patient: this runs on CPU (free tier)
12
  """
13
- def sayPoetry(prompt, temp):
14
  gen = pipe(prompt, max_length=96, temperature = temp)[0]["generated_text"]
15
  poetry =""
16
  for line in gen.split('.')[:-1]:
 
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 one of the examples
10
  - generate poetry
11
  - be patient: this runs on CPU (free tier)
12
  """
13
+ def sayPoetry(prompt, temp=0.95):
14
  gen = pipe(prompt, max_length=96, temperature = temp)[0]["generated_text"]
15
  poetry =""
16
  for line in gen.split('.')[:-1]: