Dineflow commited on
Commit
5a9efa2
·
verified ·
1 Parent(s): d2e96db

I have change input to feedback

Browse files
Files changed (1) hide show
  1. handler.py +3 -3
handler.py CHANGED
@@ -14,14 +14,14 @@ class EndpointHandler:
14
  predicted_rating = self.model.predict(review_tfidf)[0]
15
  return predicted_rating
16
 
17
- def __call__(self, inputs):
18
  try:
19
  # Ensure inputs is a JSON string
20
- if not isinstance(inputs, str):
21
  return json.dumps({"error": "Input must be a JSON string"})
22
 
23
  # Using regex to extract the value of "inputs" from the JSON string
24
- match = re.search(r'\"inputs\"\s*:\s*\"(.*?)\"', inputs)
25
 
26
  if not match:
27
  return json.dumps({"error": "No valid review provided or incorrect format"})
 
14
  predicted_rating = self.model.predict(review_tfidf)[0]
15
  return predicted_rating
16
 
17
+ def __call__(self, feedback):
18
  try:
19
  # Ensure inputs is a JSON string
20
+ if not isinstance(feedback, str):
21
  return json.dumps({"error": "Input must be a JSON string"})
22
 
23
  # Using regex to extract the value of "inputs" from the JSON string
24
+ match = re.search(r'\"feedback\"\s*:\s*\"(.*?)\"', feedback)
25
 
26
  if not match:
27
  return json.dumps({"error": "No valid review provided or incorrect format"})