DreamStream-1 commited on
Commit
b6cafe0
·
verified ·
1 Parent(s): 1aa6549

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -11,7 +11,6 @@ from nltk.stem.lancaster import LancasterStemmer
11
  from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
12
  import requests
13
  import pandas as pd
14
- import tempfile
15
 
16
  # Ensure necessary NLTK resources are downloaded
17
  nltk.download('punkt')
@@ -213,7 +212,7 @@ def gradio_interface(message, location, state):
213
  # Stage 4: Search for Wellness Professionals
214
  wellness_results = search_wellness_professionals(location)
215
 
216
- # Return the 6 values required by Gradio
217
  return history, sentiment, emotion, suggestions, wellness_results, history # Last 'history' is for state
218
 
219
  # Gradio interface setup
@@ -229,7 +228,7 @@ iface = gr.Interface(
229
  gr.Textbox(label="Sentiment Analysis"),
230
  gr.Textbox(label="Detected Emotion"),
231
  gr.Dataframe(label="Suggestions & Resources"),
232
- gr.File(label="Download Wellness Professionals CSV"),
233
  gr.State() # One state output
234
  ],
235
  allow_flagging="never",
 
11
  from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
12
  import requests
13
  import pandas as pd
 
14
 
15
  # Ensure necessary NLTK resources are downloaded
16
  nltk.download('punkt')
 
212
  # Stage 4: Search for Wellness Professionals
213
  wellness_results = search_wellness_professionals(location)
214
 
215
+ # Return the results in a tabular form within the Gradio interface
216
  return history, sentiment, emotion, suggestions, wellness_results, history # Last 'history' is for state
217
 
218
  # Gradio interface setup
 
228
  gr.Textbox(label="Sentiment Analysis"),
229
  gr.Textbox(label="Detected Emotion"),
230
  gr.Dataframe(label="Suggestions & Resources"),
231
+ gr.Dataframe(label="Nearby Wellness Professionals"), # Display results as a table
232
  gr.State() # One state output
233
  ],
234
  allow_flagging="never",