Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -33,17 +33,42 @@ def generate_text(input_text):
|
|
33 |
cleaned_output_text = output_text.replace(input_text, "")
|
34 |
return cleaned_output_text
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
cleaned_output_text = output_text.replace(input_text, "")
|
34 |
return cleaned_output_text
|
35 |
|
36 |
+
block = gr.Blocks()
|
37 |
+
|
38 |
+
|
39 |
+
with block:
|
40 |
+
gr.Markdown("""<h1><center>Build Yo'own ChatGPT with OpenAI API & Gradio</center></h1>
|
41 |
+
""")
|
42 |
+
chatbot = gr.Chatbot()
|
43 |
+
message = gr.Textbox(placeholder=prompt)
|
44 |
+
state = gr.State()
|
45 |
+
submit = gr.Button("SEND")
|
46 |
+
submit.click(generate_text, inputs=[message, state], outputs=[chatbot, state])
|
47 |
+
|
48 |
+
block.launch(debug = True)
|
49 |
+
|
50 |
+
|
51 |
+
|
52 |
+
|
53 |
+
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
|
59 |
+
|
60 |
+
|
61 |
+
# logo = (
|
62 |
+
# "<div >"
|
63 |
+
# "<img src='ai-icon.png'alt='image One'>"
|
64 |
+
# + "</div>"
|
65 |
+
# )
|
66 |
+
# text_generation_interface = gr.Interface(
|
67 |
+
# fn=generate_text,
|
68 |
+
# inputs=[
|
69 |
+
# gr.inputs.Textbox(label="Input Text"),
|
70 |
+
# ],
|
71 |
+
# outputs=gr.inputs.Textbox(label="Generated Text"),
|
72 |
+
# title="Falcon-7B Instruct",
|
73 |
+
# image=logo
|
74 |
+
# ).launch()
|