Prakhar1000 commited on
Commit
a968937
·
1 Parent(s): 1c80cfd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -7,10 +7,13 @@ import re
7
 
8
 
9
  def process_data_sample(example):
10
- instruction = example.get("Instruction", "No Instruction Provided")
 
 
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