Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 = [['أنت'
|
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]:
|