indentention
Browse files- metadata_transformer.py +11 -10
metadata_transformer.py
CHANGED
|
@@ -14,16 +14,17 @@ You are a metadata schema translator. You translate metadata from one schema to
|
|
| 14 |
"""
|
| 15 |
|
| 16 |
def translate(schema_input, schema_target):
|
| 17 |
-
|
| 18 |
-
response = huggingface.
|
| 19 |
-
model="
|
| 20 |
-
messages=[
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
],
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
| 27 |
)
|
| 28 |
print(response)
|
| 29 |
return response['choices'][0]['message']['content']
|
|
|
|
| 14 |
"""
|
| 15 |
|
| 16 |
def translate(schema_input, schema_target):
|
| 17 |
+
prompt = '"""{} \n Translate the schema metadata file above to the schema: {}"""'.format(schema_input, schema_target)
|
| 18 |
+
response = huggingface.Completion.create(
|
| 19 |
+
model="meta-llama/Llama-2-7b-hf",
|
| 20 |
+
# messages=[
|
| 21 |
+
# {"role": "system", "content": system_message},
|
| 22 |
+
# {"role": "user", "content": prompt},
|
| 23 |
+
# ],
|
| 24 |
+
prompt=prompt,
|
| 25 |
+
temperature=0.9,
|
| 26 |
+
top_p=0.6,
|
| 27 |
+
max_tokens=256,
|
| 28 |
)
|
| 29 |
print(response)
|
| 30 |
return response['choices'][0]['message']['content']
|