Spaces:
Build error
Build error
refine prompt
Browse files- llm_toolkit/translation_utils.py +2 -4
- requirements.txt +1 -0
llm_toolkit/translation_utils.py
CHANGED
@@ -127,10 +127,8 @@ def load_translation_dataset(data_path, tokenizer=None, num_shots=5):
|
|
127 |
example_translations = "Example Translations:\n"
|
128 |
for i in range(num_shots):
|
129 |
example_translations += f"Chinese: {datasets['train'][i]['chinese']}\n"
|
130 |
-
example_translations +=
|
131 |
-
|
132 |
-
)
|
133 |
-
translation_prompt = translation_prompt + example_translations
|
134 |
|
135 |
translation_prompt = translation_prompt + "Chinese: {}\nEnglish:"
|
136 |
|
|
|
127 |
example_translations = "Example Translations:\n"
|
128 |
for i in range(num_shots):
|
129 |
example_translations += f"Chinese: {datasets['train'][i]['chinese']}\n"
|
130 |
+
example_translations += f"English: {datasets['train'][i]['english']}\n"
|
131 |
+
translation_prompt = translation_prompt + example_translations + "\n"
|
|
|
|
|
132 |
|
133 |
translation_prompt = translation_prompt + "Chinese: {}\nEnglish:"
|
134 |
|
requirements.txt
CHANGED
@@ -13,6 +13,7 @@ packaging
|
|
13 |
langchain_openai==0.1.13
|
14 |
wandb==0.17.4
|
15 |
transformers==4.43.3
|
|
|
16 |
sentencepiece==0.2.0
|
17 |
einops==0.8.0
|
18 |
accelerate==0.32.1
|
|
|
13 |
langchain_openai==0.1.13
|
14 |
wandb==0.17.4
|
15 |
transformers==4.43.3
|
16 |
+
bitsandbytes==0.43.3
|
17 |
sentencepiece==0.2.0
|
18 |
einops==0.8.0
|
19 |
accelerate==0.32.1
|