Spaces:
Runtime error
Runtime error
TogetherAI
commited on
Commit
Β·
dc85e2e
1
Parent(s):
f9e0a72
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,6 @@ tokenizer = AutoTokenizer.from_pretrained("merve/chatgpt-prompts-bart-long")
|
|
5 |
model = AutoModelForSeq2SeqLM.from_pretrained("merve/chatgpt-prompts-bart-long", from_tf=True)
|
6 |
|
7 |
def generate(prompt):
|
8 |
-
|
9 |
batch = tokenizer(prompt, return_tensors="pt")
|
10 |
generated_ids = model.generate(batch["input_ids"], max_new_tokens=150)
|
11 |
output = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
|
@@ -15,6 +14,13 @@ input_component = gr.Textbox(label = "Input a persona, e.g. photographer", value
|
|
15 |
output_component = gr.Textbox(label = "Prompt")
|
16 |
examples = [["photographer"], ["developer"]]
|
17 |
description = "This app generates ChatGPT prompts, it's based on a BART model trained on [this dataset](https://huggingface.co/datasets/fka/awesome-chatgpt-prompts). π Simply enter a persona that you want the prompt to be generated based on. π§π»π§π»βππ§π»βπ¨π§π»βπ¬π§π»βπ»π§πΌβπ«π§π½βπΎ"
|
18 |
-
gr.Interface(generate, inputs = input_component, outputs=output_component, examples=examples, title = "π¨π»βπ€ ChatGPT Prompt Generator π¨π»βπ€", description=description).launch()
|
19 |
-
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
model = AutoModelForSeq2SeqLM.from_pretrained("merve/chatgpt-prompts-bart-long", from_tf=True)
|
6 |
|
7 |
def generate(prompt):
|
|
|
8 |
batch = tokenizer(prompt, return_tensors="pt")
|
9 |
generated_ids = model.generate(batch["input_ids"], max_new_tokens=150)
|
10 |
output = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
|
|
|
14 |
output_component = gr.Textbox(label = "Prompt")
|
15 |
examples = [["photographer"], ["developer"]]
|
16 |
description = "This app generates ChatGPT prompts, it's based on a BART model trained on [this dataset](https://huggingface.co/datasets/fka/awesome-chatgpt-prompts). π Simply enter a persona that you want the prompt to be generated based on. π§π»π§π»βππ§π»βπ¨π§π»βπ¬π§π»βπ»π§πΌβπ«π§π½βπΎ"
|
|
|
|
|
17 |
|
18 |
+
gr.Interface(
|
19 |
+
generate,
|
20 |
+
inputs = input_component,
|
21 |
+
outputs = output_component,
|
22 |
+
examples = examples,
|
23 |
+
title = "π¨π»βπ€ ChatGPT Prompt Generator π¨π»βπ€",
|
24 |
+
description = description,
|
25 |
+
theme = "ParityError/Interstellar" # Ihr spezifiziertes Theme
|
26 |
+
).launch()
|