Spaces:
Sleeping
Sleeping
Mel Seto
commited on
Commit
·
108259c
1
Parent(s):
6ad01ae
revert to correct model; improve prompt to make more likely to return a 成語
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ USE_MOCK = False # Set False to use the real Cerebras API
|
|
| 16 |
if not USE_MOCK:
|
| 17 |
client = InferenceClient(
|
| 18 |
provider="cerebras",
|
| 19 |
-
model="
|
| 20 |
api_key=os.environ["HF_TOKEN"]
|
| 21 |
)
|
| 22 |
|
|
@@ -34,7 +34,7 @@ def generate_idiom_mock(situation: str):
|
|
| 34 |
def generate_idiom(situation: str, client):
|
| 35 |
prompt = f"""
|
| 36 |
You are a wise assistant. Given a situation, respond with exactly:
|
| 37 |
-
1. A Chinese idiom (成语)
|
| 38 |
2. Its pinyin
|
| 39 |
3. A short English explanation
|
| 40 |
|
|
|
|
| 16 |
if not USE_MOCK:
|
| 17 |
client = InferenceClient(
|
| 18 |
provider="cerebras",
|
| 19 |
+
model="meta-llama/Llama-3.3-70B-Instruct",
|
| 20 |
api_key=os.environ["HF_TOKEN"]
|
| 21 |
)
|
| 22 |
|
|
|
|
| 34 |
def generate_idiom(situation: str, client):
|
| 35 |
prompt = f"""
|
| 36 |
You are a wise assistant. Given a situation, respond with exactly:
|
| 37 |
+
1. A traditional Chinese idiom (成语), which is different from a 四字格, that conveys the idea of the given situation
|
| 38 |
2. Its pinyin
|
| 39 |
3. A short English explanation
|
| 40 |
|