Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ def ocr_inference(img, lang):
|
|
42 |
def make_flashcards(words, language):
|
43 |
|
44 |
system_prompt = (
|
45 |
-
f"Given the following {language} words, define each word and create an example sentence using the word
|
46 |
|
47 |
)
|
48 |
user_prompt = f"{system_prompt}\n\nText:\n{text}"
|
@@ -56,7 +56,6 @@ def make_flashcards(words, language):
|
|
56 |
output = [w.strip() for w in last_line.split(":") if w.strip()]
|
57 |
return output
|
58 |
|
59 |
-
|
60 |
words=text_inference(text, "korean")
|
61 |
print("OUTPUT TOUT OUETOI EIFJ IEFJ",words)
|
62 |
print("flashcard output:",make_flashcards(words, "korean"))
|
|
|
42 |
def make_flashcards(words, language):
|
43 |
|
44 |
system_prompt = (
|
45 |
+
f"Given the following {language} words, define each word and create an example sentence using the word. For each word, return the word, the definition, the example sentence, and the translation of the example sentence"
|
46 |
|
47 |
)
|
48 |
user_prompt = f"{system_prompt}\n\nText:\n{text}"
|
|
|
56 |
output = [w.strip() for w in last_line.split(":") if w.strip()]
|
57 |
return output
|
58 |
|
|
|
59 |
words=text_inference(text, "korean")
|
60 |
print("OUTPUT TOUT OUETOI EIFJ IEFJ",words)
|
61 |
print("flashcard output:",make_flashcards(words, "korean"))
|