Update app.py
Browse files
app.py
CHANGED
|
@@ -50,8 +50,6 @@ def get_answer(query, context, model="meta-llama/Llama-3.3-70B-Instruct"):
|
|
| 50 |
client = get_inference_client()
|
| 51 |
|
| 52 |
PROMPT = """<|start_header_id|>user<|end_header_id|>
|
| 53 |
-
|
| 54 |
-
Context: {contesto}, question: {domanda}
|
| 55 |
|
| 56 |
Use exclusively the information contained in the provided context to reformulate the text in about 120 words.
|
| 57 |
take into consideration the provided question as a reference for the formulation of the answer.
|
|
@@ -60,7 +58,9 @@ def get_answer(query, context, model="meta-llama/Llama-3.3-70B-Instruct"):
|
|
| 60 |
In the output, check that there are no grammatical errors. If you find errors, correct them.
|
| 61 |
Do not add information that is not present in the original text.
|
| 62 |
The output must have the same language of the question. If not translate it.
|
| 63 |
-
In the output, never say that you are summarizing the text.
|
|
|
|
|
|
|
| 64 |
|
| 65 |
response = client.chat.completions.create(
|
| 66 |
model=model,
|
|
@@ -130,15 +130,15 @@ def modify_xml(eaf_file, model="meta-llama/Llama-3.3-70B-Instruct"):
|
|
| 130 |
<CONSTRAINT DESCRIPTION="1-1 association with a parent annotation" STEREOTYPE="Symbolic_Association"/>
|
| 131 |
<CONSTRAINT DESCRIPTION="Time alignable annotations within the parent annotation's time interval, gaps are allowed" STEREOTYPE="Included_In"/>
|
| 132 |
</ANNOTATION_DOCUMENT>
|
| 133 |
-
|
| 134 |
-
provided .eaf file and instructions: {code}
|
| 135 |
-
|
| 136 |
Modify the provided eaf file according to the instructions given by the user.
|
| 137 |
Take the above example eaf file to better understand the file structure and where instructions start.
|
| 138 |
Parse the eaf file step by step. Remember that is XML-based.
|
| 139 |
Then follow the instructions step by step.
|
| 140 |
Don't add any additional information, explanations or reasoning steps to the ouput if not explicitely requested in the instructions.
|
| 141 |
-
Report the final output only.
|
|
|
|
|
|
|
| 142 |
|
| 143 |
response = client.chat.completions.create(
|
| 144 |
model=model,
|
|
|
|
| 50 |
client = get_inference_client()
|
| 51 |
|
| 52 |
PROMPT = """<|start_header_id|>user<|end_header_id|>
|
|
|
|
|
|
|
| 53 |
|
| 54 |
Use exclusively the information contained in the provided context to reformulate the text in about 120 words.
|
| 55 |
take into consideration the provided question as a reference for the formulation of the answer.
|
|
|
|
| 58 |
In the output, check that there are no grammatical errors. If you find errors, correct them.
|
| 59 |
Do not add information that is not present in the original text.
|
| 60 |
The output must have the same language of the question. If not translate it.
|
| 61 |
+
In the output, never say that you are summarizing the text.
|
| 62 |
+
|
| 63 |
+
Context: {contesto}, question: {domanda} <|eot_id|>"""
|
| 64 |
|
| 65 |
response = client.chat.completions.create(
|
| 66 |
model=model,
|
|
|
|
| 130 |
<CONSTRAINT DESCRIPTION="1-1 association with a parent annotation" STEREOTYPE="Symbolic_Association"/>
|
| 131 |
<CONSTRAINT DESCRIPTION="Time alignable annotations within the parent annotation's time interval, gaps are allowed" STEREOTYPE="Included_In"/>
|
| 132 |
</ANNOTATION_DOCUMENT>
|
| 133 |
+
|
|
|
|
|
|
|
| 134 |
Modify the provided eaf file according to the instructions given by the user.
|
| 135 |
Take the above example eaf file to better understand the file structure and where instructions start.
|
| 136 |
Parse the eaf file step by step. Remember that is XML-based.
|
| 137 |
Then follow the instructions step by step.
|
| 138 |
Don't add any additional information, explanations or reasoning steps to the ouput if not explicitely requested in the instructions.
|
| 139 |
+
Report the final output only.
|
| 140 |
+
|
| 141 |
+
Provided .eaf file and instructions: {code} <|eot_id|>"""
|
| 142 |
|
| 143 |
response = client.chat.completions.create(
|
| 144 |
model=model,
|