Skip to content

Commit

Permalink
removing unused fields of body
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackson Barbosa committed Dec 7, 2023
1 parent 97f132a commit d151431
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions bothub/api/v2/zeroshot/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ def post(self, request):

body = {
"input": {
"text": data.get("text"),
"language": data.get("language"),
"prompt": prompt,
"sampling_params": {
"max_tokens": settings.ZEROSHOT_MAX_TOKENS,
Expand Down Expand Up @@ -124,9 +122,10 @@ def post(self, request):

response = {"output": {}}
if response_nlp.status_code == 200:
formatted_classification = FormatClassification(
response_nlp.json().get("output")
).get_classify(language=data.get("language"), options=data.get("options"))
classification = response_nlp.json().get("output")
classification_formatter = FormatClassification(classification)

formatted_classification = classification_formatter.get_classify(language=data.get("language"), options=data.get("options"))

response["output"] = formatted_classification

Expand Down

0 comments on commit d151431

Please sign in to comment.