cryptocalypse commited on
Commit
2b61c31
1 Parent(s): ce78ec6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -16
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
- demo = gr.ChatInterface(
46
- respond,
47
- additional_inputs=[
48
- gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
49
- gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
50
- gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
51
- gr.Slider(
52
- minimum=0.1,
53
- maximum=1.0,
54
- value=0.95,
55
- step=0.05,
56
- label="Top-p (nucleus sampling)",
57
- ),
58
- ],
59
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
 
62
  if __name__ == "__main__":
63
- demo.launch()
 
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()