Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 (
|
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 |
-
-
|
|
|
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"]
|