Spaces:
Runtime error
Runtime error
Ramadhiana commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,11 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
from transformers import pipeline
|
| 4 |
-
from starlette.middleware.sessions import SessionMiddleware
|
| 5 |
|
| 6 |
# Ganti dengan model kamu di Hugging Face
|
| 7 |
pipe = pipeline("text-classification", model="Ranti0603/job_classifier_model_v2")
|
| 8 |
|
| 9 |
-
def respond(message, history
|
| 10 |
result = pipe(message, truncation=True)[0]
|
| 11 |
label = result["label"]
|
| 12 |
score = round(result["score"] * 100, 2)
|
|
@@ -25,8 +24,6 @@ with gr.Blocks() as demo:
|
|
| 25 |
type="messages",
|
| 26 |
chatbot=gr.Chatbot(height=400),
|
| 27 |
)
|
| 28 |
-
|
| 29 |
-
demo.app.add_middleware(SessionMiddleware, secret_key="kominfo_123456_aitf_prog")
|
| 30 |
-
|
| 31 |
if __name__ == "__main__":
|
| 32 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
from transformers import pipeline
|
|
|
|
| 4 |
|
| 5 |
# Ganti dengan model kamu di Hugging Face
|
| 6 |
pipe = pipeline("text-classification", model="Ranti0603/job_classifier_model_v2")
|
| 7 |
|
| 8 |
+
def respond(message, history):
|
| 9 |
result = pipe(message, truncation=True)[0]
|
| 10 |
label = result["label"]
|
| 11 |
score = round(result["score"] * 100, 2)
|
|
|
|
| 24 |
type="messages",
|
| 25 |
chatbot=gr.Chatbot(height=400),
|
| 26 |
)
|
| 27 |
+
|
|
|
|
|
|
|
| 28 |
if __name__ == "__main__":
|
| 29 |
demo.launch()
|