Spaces:
Sleeping
Sleeping
on1onmangoes
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -54,7 +54,84 @@ TITLE = "<h1 style='text-align:center;'>My Gradio Chat App</h1>"
|
|
54 |
# Create the Gradio Blocks interface
|
55 |
with gr.Blocks(css=CSS) as demo:
|
56 |
gr.HTML(TITLE)
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
with gr.Tab("Chat"):
|
59 |
chatbot = gr.Chatbot() # Create a chatbot interface
|
60 |
|
@@ -63,6 +140,7 @@ with gr.Blocks(css=CSS) as demo:
|
|
63 |
chatbot=chatbot,
|
64 |
additional_inputs_accordion=gr.Accordion(label="⚙️ Parameters", open=False, render=False),
|
65 |
additional_inputs=[
|
|
|
66 |
gr.Textbox(
|
67 |
value="You are an expert assistant",
|
68 |
label="System Prompt",
|
|
|
54 |
# Create the Gradio Blocks interface
|
55 |
with gr.Blocks(css=CSS) as demo:
|
56 |
gr.HTML(TITLE)
|
57 |
+
## OG v9 comments
|
58 |
+
# gr.ChatInterface(
|
59 |
+
# fn=stream_chat_with_rag,
|
60 |
+
# chatbot=chatbot,
|
61 |
+
# fill_height=True,
|
62 |
+
# #gr.dropdown(['rosariarossi','bianchifiordaliso','lorenzoverdi'],label="Select Client"),
|
63 |
+
# additional_inputs_accordion=gr.Accordion(label="⚙️ Parameters", open=False, render=False),
|
64 |
+
# additional_inputs=[
|
65 |
+
# gr.Dropdown(['rosariarossi','bianchifiordaliso','lorenzoverdi'],value="rosariarossi",label="Select Client", render=False,),
|
66 |
+
# gr.Textbox(
|
67 |
+
# # value="""Using the information contained in the context,
|
68 |
+
# # give a comprehensive answer to the question.
|
69 |
+
# # Respond only to the question asked, response should be concise and relevant to the question.
|
70 |
+
# # Provide the number of the source document when relevant.
|
71 |
+
# # If the answer cannot be deduced from the context, do not give an answer""",
|
72 |
+
# value ="""You are an expert assistant""",
|
73 |
+
# label="System Prompt",
|
74 |
+
# render=False,
|
75 |
+
# ),
|
76 |
+
# gr.Slider(
|
77 |
+
# minimum=1,
|
78 |
+
# maximum=10,
|
79 |
+
# step=1,
|
80 |
+
# value=10,
|
81 |
+
# label="Number of Initial Documents to Retrieve",
|
82 |
+
# render=False,
|
83 |
+
# ),
|
84 |
+
# gr.Slider(
|
85 |
+
# minimum=1,
|
86 |
+
# maximum=10,
|
87 |
+
# step=1,
|
88 |
+
# value=9,
|
89 |
+
# label="Number of Final Documents to Retrieve",
|
90 |
+
# render=False,
|
91 |
+
# ),
|
92 |
+
# gr.Slider(
|
93 |
+
# minimum=0.2,
|
94 |
+
# maximum=1,
|
95 |
+
# step=0.1,
|
96 |
+
# value=0,
|
97 |
+
# label="Temperature",
|
98 |
+
# render=False,
|
99 |
+
# ),
|
100 |
+
# gr.Slider(
|
101 |
+
# minimum=128,
|
102 |
+
# maximum=8192,
|
103 |
+
# step=1,
|
104 |
+
# value=1024,
|
105 |
+
# label="Max new tokens",
|
106 |
+
# render=False,
|
107 |
+
# ),
|
108 |
+
# gr.Slider(
|
109 |
+
# minimum=0.0,
|
110 |
+
# maximum=1.0,
|
111 |
+
# step=0.1,
|
112 |
+
# value=1.0,
|
113 |
+
# label="top_p",
|
114 |
+
# render=False,
|
115 |
+
# ),
|
116 |
+
# gr.Slider(
|
117 |
+
# minimum=1,
|
118 |
+
# maximum=20,
|
119 |
+
# step=1,
|
120 |
+
# value=20,
|
121 |
+
# label="top_k",
|
122 |
+
# render=False,
|
123 |
+
# ),
|
124 |
+
# gr.Slider(
|
125 |
+
# minimum=0.0,
|
126 |
+
# maximum=2.0,
|
127 |
+
# step=0.1,
|
128 |
+
# value=1.2,
|
129 |
+
# label="Repetition penalty",
|
130 |
+
# render=False,
|
131 |
+
# ),
|
132 |
+
# ],
|
133 |
+
|
134 |
+
# )
|
135 |
with gr.Tab("Chat"):
|
136 |
chatbot = gr.Chatbot() # Create a chatbot interface
|
137 |
|
|
|
140 |
chatbot=chatbot,
|
141 |
additional_inputs_accordion=gr.Accordion(label="⚙️ Parameters", open=False, render=False),
|
142 |
additional_inputs=[
|
143 |
+
gr.Dropdown(['rosariarossi','bianchifiordaliso','lorenzoverdi'],value="rosariarossi",label="Select Client", render=False,),
|
144 |
gr.Textbox(
|
145 |
value="You are an expert assistant",
|
146 |
label="System Prompt",
|