Spaces:
Sleeping
Sleeping
downgrade outlines to 0.0.36 to avoid issue 820
Browse files- app.py +11 -7
- requirements.txt +1 -1
app.py
CHANGED
@@ -11,8 +11,8 @@ from pathlib import Path
|
|
11 |
from faster_whisper import WhisperModel
|
12 |
from huggingface_hub import hf_hub_download
|
13 |
|
14 |
-
llm_repo_id = "Qwen/Qwen2.5-
|
15 |
-
llm_filename="qwen2.5-
|
16 |
asr_repo_id = "Luigi/whisper-small-zh_tw-ct2"
|
17 |
|
18 |
llm_model_path = hf_hub_download(repo_id=llm_repo_id, filename=llm_filename)
|
@@ -55,14 +55,18 @@ def predict_with_llm(text):
|
|
55 |
model = load_outlines_model()
|
56 |
|
57 |
prompt = f"""
|
58 |
-
You are an
|
59 |
|
60 |
-
I'm going to provide you with a
|
61 |
-
You
|
62 |
-
|
|
|
|
|
|
|
|
|
63 |
{{\"result\": \"Reservation\"}} or {{\"result\": \"Others\"}}
|
64 |
|
65 |
-
Here is the
|
66 |
""".strip()
|
67 |
|
68 |
classifier = choice(model, ["Reservation", "Others"])
|
|
|
11 |
from faster_whisper import WhisperModel
|
12 |
from huggingface_hub import hf_hub_download
|
13 |
|
14 |
+
llm_repo_id = "Qwen/Qwen2.5-1.5B-Instruct-GGUF"
|
15 |
+
llm_filename="qwen2.5-1.5b-instruct-q8_0.gguf"
|
16 |
asr_repo_id = "Luigi/whisper-small-zh_tw-ct2"
|
17 |
|
18 |
llm_model_path = hf_hub_download(repo_id=llm_repo_id, filename=llm_filename)
|
|
|
55 |
model = load_outlines_model()
|
56 |
|
57 |
prompt = f"""
|
58 |
+
You are an expert in classification of restautant customers' message.
|
59 |
|
60 |
+
I'm going to provide you with a message from a restautant customer.
|
61 |
+
You have to classify it in one of the follwing two intents:
|
62 |
+
|
63 |
+
Reservation: Inquiries and requests highly related to table reservations and seating
|
64 |
+
Others: All other messages that do not involve table booking or reservations
|
65 |
+
|
66 |
+
Please reply with *only* the name of the intent labels in a JSON object like:
|
67 |
{{\"result\": \"Reservation\"}} or {{\"result\": \"Others\"}}
|
68 |
|
69 |
+
Here is the message to classify: {text}
|
70 |
""".strip()
|
71 |
|
72 |
classifier = choice(model, ["Reservation", "Others"])
|
requirements.txt
CHANGED
@@ -5,6 +5,6 @@ torch
|
|
5 |
torchaudio
|
6 |
faster-whisper
|
7 |
soundfile
|
8 |
-
outlines[llamacpp]==0.0.36 # https://github.com/dottxt-ai/outlines/issues/820
|
9 |
numpy>=1.24,<2.0
|
10 |
llama-cpp-python
|
|
|
5 |
torchaudio
|
6 |
faster-whisper
|
7 |
soundfile
|
8 |
+
outlines[llamacpp]==0.0.36 # issue beyond 0.0.36 https://github.com/dottxt-ai/outlines/issues/820
|
9 |
numpy>=1.24,<2.0
|
10 |
llama-cpp-python
|