Comments (6)
Hey, I fixed it. I had to do gradio==4.8.0 and change to "
label = gr.Label(num_top_classes=5)"
from healifyai--llm-based-healthcare-system.
@jainishmehta
Gradio package is possibly bringing in changes. Pretty recent.
GradioDeprecationWarning: Usage of gradio.outputs is deprecated, and will not be supported in the future, please import your components from gradio.components
Did you use/follow the requirements.txt of the project? As it is stated,
gradio==3.34.0
As always remember the python best practice of using virtual environment for installing packages.
from healifyai--llm-based-healthcare-system.
I directly deployed on huggingface where there was no issue. So, I am sure it is supposed to work locally which is what you are doing. I am sharing requirements.txt of huggingface directly here. Try installing that on a fresh virtual environment:
gradio==3.34.0
gradio_client==0.2.6
ohmeow-blurr==1.0.5
torch==1.13.1
transformers==4.33.2
In the upcoming days I will check the app code locally if possible in my free time.
from healifyai--llm-based-healthcare-system.
thanks :)
from healifyai--llm-based-healthcare-system.
I use this code on your app.py now:
import gradio as gr
from transformers import AutoTokenizer
import torch, json
from fastai.text.all import *
from blurr.text.modeling.all import *
from blurr.text.data.all import *
from fastai.vision.all import *
with open('question_labels.json', 'r') as f:
question_dictionary = json.load(f)
que_classes = list(question_dictionary.keys())
blurr_model = load_learner('healifyLLM-stage4.pkl')
probs = blurr_model.blurr_predict('headache')[0]['probs']
values_and_probs = dict(zip(que_classes, map(float, probs)))
print(sorted(values_and_probs.items(), key=lambda x: x[1], reverse=True)[:5])
def detect_question(text):
blurr_model = load_learner('healifyLLM-stage4.pkl')
probs = blurr_model.blurr_predict(text)[0]['probs']
values_and_probs = dict(zip(que_classes, map(float, probs)))
return dict(sorted(values_and_probs.items(), key=lambda x: x[1], reverse=True))
label = gr.outputs.Label(num_top_classes=5)
iface = gr.Interface(fn=detect_question, inputs="text", outputs = label)
if name == "main":
iface.launch(show_api=False)
I get the right values from your model (so the model is not the issue)
however I keep getting error:
from healifyai--llm-based-healthcare-system.
Thatβs fantastic news! π
I think I will bring a second update to the HuggingFace gradio app soon, to make it a bit more interactive. Feel free to check it out.
from healifyai--llm-based-healthcare-system.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from healifyai--llm-based-healthcare-system.