Spaces:
Sleeping
Sleeping
Commit ·
a968937
1
Parent(s): 1c80cfd
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,10 +7,13 @@ import re
|
|
| 7 |
|
| 8 |
|
| 9 |
def process_data_sample(example):
|
| 10 |
-
|
|
|
|
|
|
|
| 11 |
processed_example = "You have to generate api developer documentation json object which helps the user to create api documentation. ### Instruction : " + instruction + ". ### Response :"
|
| 12 |
return processed_example
|
| 13 |
|
|
|
|
| 14 |
def processing_ouput(model_response):
|
| 15 |
pattern = r"### Response :(.*)"
|
| 16 |
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
def process_data_sample(example):
|
| 10 |
+
# Convert the 'Instruction' dictionary to a JSON string if it's not already a string
|
| 11 |
+
instruction = json.dumps(example.get("Instruction", {})) if isinstance(example.get("Instruction"), dict) else example.get("Instruction", "No Instruction Provided")
|
| 12 |
+
|
| 13 |
processed_example = "You have to generate api developer documentation json object which helps the user to create api documentation. ### Instruction : " + instruction + ". ### Response :"
|
| 14 |
return processed_example
|
| 15 |
|
| 16 |
+
|
| 17 |
def processing_ouput(model_response):
|
| 18 |
pattern = r"### Response :(.*)"
|
| 19 |
|