mgokg commited on
Commit
6cd0567
·
verified ·
1 Parent(s): 6f87de6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -10
app.py CHANGED
@@ -9,6 +9,17 @@ import json
9
  import groq
10
  import os
11
 
 
 
 
 
 
 
 
 
 
 
 
12
  api_key = os.getenv('groq')
13
  client = groq.Client(api_key=api_key)
14
 
@@ -88,14 +99,20 @@ def process_ort(ort):
88
  #df = pd.DataFrame(data_dict)
89
  #return df
90
  return vereine
91
-
92
- demo = gr.Interface(
93
- fn=process_ort,
94
- inputs=gr.Textbox(lines=1, placeholder="Geben Sie Ihre Suchanfrage ein..."),
95
- #outputs=gr.JSON(label="# Ausgabe"),
96
- outputs="text",
97
- title="# google websearch",
98
- description="Geben Sie eine Suchanfrage ein..."
99
- )
100
 
101
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  import groq
10
  import os
11
 
12
+ custom_css = """
13
+ #md {
14
+ height: 400px;
15
+ font-size: 30px;
16
+ background: #202020;
17
+ padding: 20px;
18
+ color: white;
19
+ border: 1 px solid white;
20
+ }
21
+ """
22
+
23
  api_key = os.getenv('groq')
24
  client = groq.Client(api_key=api_key)
25
 
 
99
  #df = pd.DataFrame(data_dict)
100
  #return df
101
  return vereine
 
 
 
 
 
 
 
 
 
102
 
103
+
104
+ # Create the Gradio interface
105
+ with gr.Blocks(css=custom_css) as demo:
106
+ with gr.Row():
107
+ details_output = gr.Markdown(label="answer", elem_id="md")
108
+ #details_output = gr.Textbox(label="Ausgabe", value = f"\n\n\n\n")
109
+ with gr.Row():
110
+ ort_input = gr.Textbox(label="prompt", placeholder="ask anything...")
111
+ with gr.Row():
112
+ button = gr.Button("Senden")
113
+
114
+ # Connect the button to the function
115
+ button.click(fn=process_ort, inputs=ort_input, outputs=details_output)
116
+
117
+ # Launch the Gradio application
118
+ demo.launch()