Skip to content

Commit

Permalink
Merge pull request #419 from nicola-corbellini/feature/custom_llm
Browse files Browse the repository at this point in the history
Removed unnecessary header for custom llm
  • Loading branch information
pieroit authored Aug 18, 2023
2 parents 78ec23e + 93ddc6e commit 0fd0734
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions core/cat/factory/custom_llm.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Optional, List, Any, Mapping, Dict
import requests
from langchain.llms.base import LLM
from cat.log import log


class LLMDefault(LLM):
Expand Down Expand Up @@ -44,11 +43,6 @@ def _call(
"options": self.options
}

headers = {
'accept': 'application/json',
'Content-Type': 'application/json'
}

try:
response_json = requests.post(self.url, json=request_body).json()
except Exception as exc:
Expand All @@ -57,7 +51,7 @@ def _call(

generated_text = response_json["text"]

return f"AI: {generated_text}"
return generated_text

@property
def _identifying_params(self) -> Mapping[str, Any]:
Expand Down

0 comments on commit 0fd0734

Please sign in to comment.