SurabhiT commited on
Commit
c3d533a
·
verified ·
1 Parent(s): 082148d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -7
app.py CHANGED
@@ -16,9 +16,9 @@ import numpy as np
16
  api_key=os.getenv("GOOGLE_API_KEY")
17
 
18
 
19
- os.environ["OPENAI_API_KEY"] = "NA"
20
  os.environ["GOOGLE_API_KEY"] = api_key
21
- os.environ["GROQ_API_KEY"] = "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"
22
 
23
  from crewai_tools import PDFSearchTool
24
  from crewai_tools import FileReadTool
@@ -261,12 +261,28 @@ def run_ai(file, query, required_ans_format):
261
  result = crew.kickoff()
262
  return result
263
 
264
- iface = gr.Interface(
265
  fn=run_ai,
266
- inputs=[gr.File(label="Upload File"), "text", "text"],
 
 
 
 
267
  outputs="text",
268
- title="Document and Data Analyzer",
269
- description="Upload a file, enter your query, and specify the format of the expected answer"
 
 
 
 
 
 
 
 
 
 
 
 
270
  )
271
 
272
- iface.launch()
 
16
  api_key=os.getenv("GOOGLE_API_KEY")
17
 
18
 
19
+
20
  os.environ["GOOGLE_API_KEY"] = api_key
21
+
22
 
23
  from crewai_tools import PDFSearchTool
24
  from crewai_tools import FileReadTool
 
261
  result = crew.kickoff()
262
  return result
263
 
264
+ interface = gr.Interface(
265
  fn=run_ai,
266
+ inputs=[
267
+ gr.File(label="Upload File"),
268
+ gr.Textbox(label="Query"),
269
+ gr.Textbox(label="Expected Output")
270
+ ],
271
  outputs="text",
272
+ title="DocuSmart",
273
+ description=(
274
+ "Upload a file (CSV, PDF, DOCX, TXT, JSON) and enter your query to get detailed information.\n\n"
275
+ "### Instructions:\n"
276
+ "1. Upload the file you want to talk to.\n"
277
+ "2. Enter your question in the Query field.\n"
278
+ "3. Specify the desired output format, e.g., one line answer.\n"
279
+ "4. Press 'Submit' and wait for the response.\n\n"
280
+ ),
281
+ examples=[
282
+ ["LabManual.pdf", "What is RIP?", "detailed description"],
283
+ ["ElectricCarData_Clean.csv", "Which Brand has most vehicles?", "one line answer"]
284
+ ],
285
+ theme=gr.themes.Soft()
286
  )
287
 
288
+ interface.launch()