darshil3011 commited on
Commit
4376882
·
1 Parent(s): 64374d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -1,17 +1,20 @@
1
  import gradio as gr
2
  from gradio_client import Client
3
 
 
 
4
  # Function to call the Gradio API
5
  def call_gradio_api(user_input):
6
- client = Client("https://traversaal-internal-rag-faiss-gpt3-5.hf.space/")
 
7
  result = client.predict(user_input, api_name="/predict")
8
- return result
9
 
10
  # Interface for the Gradio app
11
  iface = gr.Interface(
12
  fn=call_gradio_api,
13
  inputs="text",
14
- outputs="text",
15
  layout="vertical",
16
  title="CCL Playground",
17
  description="Enter a query to get response using RAG"
 
1
  import gradio as gr
2
  from gradio_client import Client
3
 
4
+ access_token = "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"
5
+
6
  # Function to call the Gradio API
7
  def call_gradio_api(user_input):
8
+
9
+ client = Client("https://traversaal-internal-rag-faiss-gpt3-5.hf.space/", hf_token=access_token)
10
  result = client.predict(user_input, api_name="/predict")
11
+ return result[0], result[1], result[2]
12
 
13
  # Interface for the Gradio app
14
  iface = gr.Interface(
15
  fn=call_gradio_api,
16
  inputs="text",
17
+ outputs=["text","text","text"]
18
  layout="vertical",
19
  title="CCL Playground",
20
  description="Enter a query to get response using RAG"