:param engine: str TextSynth API engine (e.g. `gptj_6B`) :param truncate: bool Truncate input if too long (if False and input is too long, throw error)
(self, engine, truncate=False)
| 40 | |
| 41 | class TextSynthLM(BaseLM): |
| 42 | def __init__(self, engine, truncate=False): |
| 43 | """ |
| 44 | :param engine: str |
| 45 | TextSynth API engine (e.g. `gptj_6B`) |
| 46 | :param truncate: bool |
| 47 | Truncate input if too long (if False and input is too long, throw error) |
| 48 | """ |
| 49 | super().__init__() |
| 50 | |
| 51 | self.engine = engine |
| 52 | self.truncate = truncate |
| 53 | self.api_url = "https://api.textsynth.com" |
| 54 | # Read from environment variable TEXTSYNTH_API_SECRET_KEY |
| 55 | self.api_key = os.environ["TEXTSYNTH_API_SECRET_KEY"] |
| 56 | |
| 57 | @property |
| 58 | def eot_token_id(self): |
nothing calls this directly
no outgoing calls
no test coverage detected