AIlexDev commited on
Commit
adfeed0
·
1 Parent(s): 702d3c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -19
app.py CHANGED
@@ -1,25 +1,25 @@
1
- importieren Gradio als Gr
2
- aus der Transformatoren Importpipeline -
3
 
4
- title = "Prompt Dich weiter mit Einfach.Prompt"
5
- Beschreibung = """
6
- <p>
7
- <Mitte>
8
- Vielen Dank an Merve für dieses tolle und erste Modell von Bart.
9
- <img src="https://huggingface.co/spaces/EinfachAilex/einfach.prompt/blob/main/cover.png" alt="rick" width="250"/>
10
- </center>
11
- </p>
12
- „““
13
- Article = "<p style='text-align: center'><a href='https://arxiv.org/abs/1907.06616' target='_blank'>Rezepte zum Erstellen eines Open-Domain-Chatbots</a> </p><p style='text-align: center'><a href='https://parl.ai/projects/recipes/' target='_blank'>Original PARLAI-Code</a></p ></center></p>"
14
 
15
 
16
- Generator = Pipeline(text2text-generation, model=merve/chatgpt-prompts-bart-long)
17
 
18
- def generic_prompt ( Eingabeaufforderung ):
19
- Ausgabe = Generator (Eingabeaufforderung, max_length = 250 )
20
- Rückgabeausgabe [ 0 ][ 'generated_text' ]
21
 
22
- interface = gr.Interface(fn=generate_prompt, inputs= "text" , outputs= "text" , title= "💯 Einfach.Prompt Generator 💯 erstellt mit " ,
23
- description= "Wunsch prompt eingeben z.b. Web Designer und einen prompt für Chat.GPT erstellen lassen" )
24
 
25
- interface.launch()
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ title = "Prompt Dich weiter mit Einfach.Prompt"
5
+ description = """
6
+ <p>
7
+ <center>
8
+ Big THX at Merve for this great and first Modell by Bart..
9
+ <img src="https://huggingface.co/spaces/EinfachAilex/einfach.prompt/blob/main/cover.png" alt="rick" width="250"/>
10
+ </center>
11
+ </p>
12
+ """
13
+ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/1907.06616' target='_blank'>Recipes for building an open-domain chatbot</a></p><p style='text-align: center'><a href='https://parl.ai/projects/recipes/' target='_blank'>Original PARLAI Code</a></p></center></p>"
14
 
15
 
16
+ generator = pipeline("text2text-generation", model="merve/chatgpt-prompts-bart-long")
17
 
18
+ def generate_prompt(prompt):
19
+ output = generator(prompt, max_length=250)
20
+ return output[0]['generated_text']
21
 
22
+ interface = gr.Interface(fn=generate_prompt, inputs="text", outputs="text", title="💯 Einfach.Prompt Generator 💯 made with ",
23
+ description="Wunsch prompt eingeben z.b. Web Designer und einen prompt für Chat.GPT erstellen lassen")
24
 
25
+ interface.launch()