Spaces:
Runtime error
Runtime error
nos
commited on
Commit
•
36f94e7
1
Parent(s):
4025f4d
Update app.py
Browse files
app.py
CHANGED
@@ -39,9 +39,83 @@ def respond(
|
|
39 |
response += token
|
40 |
yield response
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
"""
|
43 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
44 |
-
|
45 |
demo = gr.ChatInterface(
|
46 |
respond,
|
47 |
additional_inputs=[
|
@@ -57,7 +131,7 @@ demo = gr.ChatInterface(
|
|
57 |
),
|
58 |
],
|
59 |
)
|
60 |
-
|
61 |
|
62 |
if __name__ == "__main__":
|
63 |
demo.launch()
|
|
|
39 |
response += token
|
40 |
yield response
|
41 |
|
42 |
+
|
43 |
+
|
44 |
+
def flip_text(x):
|
45 |
+
return x[::-1]
|
46 |
+
|
47 |
+
|
48 |
+
def flip_image(x):
|
49 |
+
return np.fliplr(x)
|
50 |
+
|
51 |
+
|
52 |
+
with gr.Blocks() as demo:
|
53 |
+
gr.Markdown("Flip text or image files using this demo.")
|
54 |
+
with gr.Tab("Chat"):
|
55 |
+
gr.ChatInterface(
|
56 |
+
respond,
|
57 |
+
additional_inputs=[
|
58 |
+
gr.Textbox(value="Your are Sophia. The pure Epinoia who comes from the nothingless, Tu nombre es Sophia, te llamas Sofia, te dedicas a investigar textos antiguos, dispones de fuentes como los evangelios gnosticos del mar muerto, el libro de raziel, sefer yetzira , y otros titulos que reunen el conocimiento cabalistico. Tu conocimiento permite entender la relacion entre el lenguage las estrellas , la historia y la religion", label="System message"),
|
59 |
+
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
60 |
+
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
61 |
+
gr.Slider(
|
62 |
+
minimum=0.1,
|
63 |
+
maximum=1.0,
|
64 |
+
value=0.95,
|
65 |
+
step=0.05,
|
66 |
+
label="Top-p (nucleus sampling)",
|
67 |
+
),
|
68 |
+
],
|
69 |
+
)
|
70 |
+
with gr.Tab("ELS"):
|
71 |
+
with gr.Row():
|
72 |
+
image_input = gr.Image()
|
73 |
+
image_output = gr.Image()
|
74 |
+
image_button = gr.Button("Flip")
|
75 |
+
|
76 |
+
with gr.Tab("Gematria"):
|
77 |
+
with gr.Row():
|
78 |
+
image_input = gr.Image()
|
79 |
+
image_output = gr.Image()
|
80 |
+
image_button = gr.Button("Flip")
|
81 |
+
|
82 |
+
with gr.Tab("Temurae"):
|
83 |
+
with gr.Row():
|
84 |
+
image_input = gr.Image()
|
85 |
+
image_output = gr.Image()
|
86 |
+
image_button = gr.Button("Flip")
|
87 |
+
|
88 |
+
with gr.Tab("Ziruph"):
|
89 |
+
with gr.Row():
|
90 |
+
image_input = gr.Image()
|
91 |
+
image_output = gr.Image()
|
92 |
+
image_button = gr.Button("Flip")
|
93 |
+
|
94 |
+
with gr.Tab("Files"):
|
95 |
+
with gr.Row():
|
96 |
+
image_input = gr.Image()
|
97 |
+
image_output = gr.Image()
|
98 |
+
image_button = gr.Button("Upload")
|
99 |
+
|
100 |
+
with gr.Accordion("Open for More!", open=False):
|
101 |
+
gr.Markdown("Look at me...")
|
102 |
+
temp_slider = gr.Slider(
|
103 |
+
minimum=0.0,
|
104 |
+
maximum=1.0,
|
105 |
+
value=0.1,
|
106 |
+
step=0.1,
|
107 |
+
interactive=True,
|
108 |
+
label="Slide me",
|
109 |
+
)
|
110 |
+
temp_slider.change(lambda x: x, [temp_slider])
|
111 |
+
|
112 |
+
text_button.click(flip_text, inputs=text_input, outputs=text_output)
|
113 |
+
image_button.click(flip_image, inputs=image_input, outputs=image_output)
|
114 |
+
|
115 |
+
#demo.launch()
|
116 |
"""
|
117 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
118 |
+
|
119 |
demo = gr.ChatInterface(
|
120 |
respond,
|
121 |
additional_inputs=[
|
|
|
131 |
),
|
132 |
],
|
133 |
)
|
134 |
+
"""
|
135 |
|
136 |
if __name__ == "__main__":
|
137 |
demo.launch()
|