Spaces:
Sleeping
Sleeping
cryptocalypse
commited on
Commit
•
2b61c31
1
Parent(s):
ce78ec6
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
|
|
|
|
3 |
|
4 |
"""
|
5 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
@@ -42,22 +44,37 @@ def respond(
|
|
42 |
"""
|
43 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
44 |
"""
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
gr.
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
label="
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
|
62 |
if __name__ == "__main__":
|
63 |
-
|
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
+
import gen
|
4 |
+
import psychohistory
|
5 |
|
6 |
"""
|
7 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
|
|
44 |
"""
|
45 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
46 |
"""
|
47 |
+
|
48 |
+
|
49 |
+
with gr.Blocks(title="PSYCHOHISTORY") as app:
|
50 |
+
|
51 |
+
|
52 |
+
with gr.Tab("Search"):
|
53 |
+
with gr.Row():
|
54 |
+
txt_search = gr.Textbox(value="Iran and Israel war",label="Search Term",scale=5)
|
55 |
+
btn_search = gr.Button("Look",scale=1)
|
56 |
+
with gr.Row():
|
57 |
+
#search_results = gr.Dataframe(type="pandas")
|
58 |
+
mem_results = gr.JSON(label="Results")
|
59 |
+
btn_search.click(
|
60 |
+
gen.generate,
|
61 |
+
inputs=[txt_search],
|
62 |
+
outputs=mem_results
|
63 |
+
)
|
64 |
+
|
65 |
+
#with gr.Row():
|
66 |
+
# big_block = gr.HTML("""
|
67 |
+
# <iframe style="scroll-padding-left: 50%; relative;background-color: #fff; height: 75vh; width: 100%; overflow-y: hidden; overflow-x: hidden;" src="https://holmesbot.com/api/shared?id=16657e456d9514"></iframe>
|
68 |
+
# """)
|
69 |
+
|
70 |
+
with gr.Tab("Graph"):
|
71 |
+
gr.load("models/stabilityai/stable-diffusion-xl-base-1.0")
|
72 |
+
with gr.Tab("Chat"):
|
73 |
+
|
74 |
+
gr.ChatInterface(
|
75 |
+
respond,
|
76 |
+
)
|
77 |
|
78 |
|
79 |
if __name__ == "__main__":
|
80 |
+
app.launch()
|