nhathuy07 commited on
Commit
bd9e29c
·
verified ·
1 Parent(s): 9dc93bd

Update flashcard_util.py

Browse files
Files changed (1) hide show
  1. flashcard_util.py +2 -2
flashcard_util.py CHANGED
@@ -50,7 +50,7 @@ async def get_definitions_from_words(words: list[str], summary: str = ""):
50
  data=json.dumps({
51
  "model": "Meta-Llama-3-8B-Instruct",
52
  "messages": [
53
- {"role": "user", "content": f"{summary}. Based on this paragraph and your knowledge, give easy-to-understand definitions for the following words: {'; '.join(words)}"}
54
  ],
55
  "presence_penalty":0.3,
56
  "temperature":0.55
@@ -67,7 +67,7 @@ async def get_definitions_from_words(words: list[str], summary: str = ""):
67
  k = k.replace('*','').strip()
68
  k = remove_numbering(k)
69
  v = v.strip()
70
- if (v != ''):
71
  rets.append((k, v))
72
  except:
73
  continue
 
50
  data=json.dumps({
51
  "model": "Meta-Llama-3-8B-Instruct",
52
  "messages": [
53
+ {"role": "user", "content": f"{summary}. Based on this paragraph and your knowledge, give concise, easy-to-understand definitions for the following words: {'; '.join(words)}. DO NOT include the words inside their respective definition."}
54
  ],
55
  "presence_penalty":0.3,
56
  "temperature":0.55
 
67
  k = k.replace('*','').strip()
68
  k = remove_numbering(k)
69
  v = v.strip()
70
+ if (v != '' and not "note: " in k.lower()):
71
  rets.append((k, v))
72
  except:
73
  continue