Spaces:
Sleeping
Sleeping
pngwn
commited on
Commit
·
7890ebe
1
Parent(s):
b04693a
asd
Browse files
app.py
CHANGED
@@ -9,14 +9,15 @@ from transformers import AutoModelWithLMHead, AutoTokenizer, pipeline, set_seed
|
|
9 |
import gradio as grad
|
10 |
from diffusers import StableDiffusionPipeline
|
11 |
|
|
|
|
|
|
|
12 |
def fn(sign, cat):
|
13 |
-
category = "career"
|
14 |
sign = "scorpio"
|
15 |
|
16 |
prompt = f"<|category|> {cat} <|horoscope|> {sign}"
|
17 |
|
18 |
-
|
19 |
-
model = AutoModelWithLMHead.from_pretrained("shahp7575/gpt2-horoscopes")
|
20 |
|
21 |
prompt_encoded = torch.tensor(tokenizer.encode(prompt)).unsqueeze(0)
|
22 |
|
|
|
9 |
import gradio as grad
|
10 |
from diffusers import StableDiffusionPipeline
|
11 |
|
12 |
+
tokenizer = AutoTokenizer.from_pretrained("shahp7575/gpt2-horoscopes")
|
13 |
+
model = AutoModelWithLMHead.from_pretrained("shahp7575/gpt2-horoscopes")
|
14 |
+
|
15 |
def fn(sign, cat):
|
|
|
16 |
sign = "scorpio"
|
17 |
|
18 |
prompt = f"<|category|> {cat} <|horoscope|> {sign}"
|
19 |
|
20 |
+
|
|
|
21 |
|
22 |
prompt_encoded = torch.tensor(tokenizer.encode(prompt)).unsqueeze(0)
|
23 |
|