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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -22
app.py CHANGED
@@ -1,27 +1,25 @@
1
- import gradio as gr
2
- from transformers import pipeline
3
 
4
- def deine_funktion(inputs):
5
- # Ihre Implementierung hier. Zum Beispiel:
6
- model = pipeline("text-generation")
7
- generated_text = model(inputs)[0]["generated_text"]
8
- return generated_text
 
 
 
 
 
9
 
10
- dein_input = gr.inputs.Textbox(lines=5, label="Your Input Here")
11
- dein_output = gr.outputs.Textbox(label="Generated Text")
12
 
13
- title = "Prompt Dich weiter mit Einfach.Prompt"
14
- description = """
15
- <p>
16
- <center>
17
- Big THX at Merve for this great and first Modell by Bart..
18
- <img src="https://huggingface.co/spaces/EinfachAilex/einfach.prompt/blob/main/cover.png" alt="rick" width="250"/>
19
- </center>
20
- </p>
21
- """
22
- 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>"
23
 
24
- iface = gr.Interface(fn=deine_funktion, inputs=dein_input, outputs=dein_output, title=title, description=description, article=article)
25
- iface.theme = './style.css' # Der Pfad zu Ihrer CSS-Datei
 
26
 
27
- iface.launch(share=True) # Startet das Interface und gibt eine öffentliche URL aus, die Sie teilen können
 
 
 
 
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()