Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -261,6 +261,7 @@ def chat(id, npc, text):
|
|
| 261 |
{npc}μ μ 보λ₯Ό μ°Έκ³ νμ¬ {npc}μ λ§μ μν©μ λ§μΆ° μμ°μ€λ½κ² μμ±ν΄μ£ΌμΈμ. ν λ¬Έμ₯λ§ μμ±νμΈμ.
|
| 262 |
|
| 263 |
[λνκΈ°λ‘]{history[npc][id]}
|
|
|
|
| 264 |
"""
|
| 265 |
|
| 266 |
inputs = tokenizer("μ", return_tensors="pt")["input_ids"]
|
|
@@ -271,12 +272,9 @@ def chat(id, npc, text):
|
|
| 271 |
#output = f"{npc}μ μλ΅μ
λλ€."
|
| 272 |
|
| 273 |
|
| 274 |
-
response = client.
|
| 275 |
model=os.environ['MODEL'],
|
| 276 |
-
|
| 277 |
-
{"role": "system", "content": prom},
|
| 278 |
-
{"role": "user", "content": f"{npc}μ λλ΅μ λ€μ λ¬Έμ₯μ λ§μΆ° μμ°μ€λ½κ² μμ±ν΄μ£ΌμΈμ. ν λ¬Έμ₯λ§ μμ±νμΈμ.\n\n{id}:" + text+f"\n\n{npc}:"}
|
| 279 |
-
]
|
| 280 |
)
|
| 281 |
output = response.choices[0].message.content
|
| 282 |
output = output.replace(".",".\n")
|
|
|
|
| 261 |
{npc}μ μ 보λ₯Ό μ°Έκ³ νμ¬ {npc}μ λ§μ μν©μ λ§μΆ° μμ°μ€λ½κ² μμ±ν΄μ£ΌμΈμ. ν λ¬Έμ₯λ§ μμ±νμΈμ.
|
| 262 |
|
| 263 |
[λνκΈ°λ‘]{history[npc][id]}
|
| 264 |
+
|
| 265 |
"""
|
| 266 |
|
| 267 |
inputs = tokenizer("μ", return_tensors="pt")["input_ids"]
|
|
|
|
| 272 |
#output = f"{npc}μ μλ΅μ
λλ€."
|
| 273 |
|
| 274 |
|
| 275 |
+
response = client.completions.create(
|
| 276 |
model=os.environ['MODEL'],
|
| 277 |
+
prompt = prom + f"{npc}μ λλ΅μ λ€μ λ¬Έμ₯μ λ§μΆ° μμ°μ€λ½κ² μμ±ν΄μ£ΌμΈμ. ν λ¬Έμ₯λ§ μμ±νμΈμ.\n\n{id}:" + text+f"\n\n{npc}:"
|
|
|
|
|
|
|
|
|
|
| 278 |
)
|
| 279 |
output = response.choices[0].message.content
|
| 280 |
output = output.replace(".",".\n")
|