: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: bool = False, **kwargs)
| 49 | @register_model("textsynth") |
| 50 | class TextSynthLM(LM): |
| 51 | def __init__(self, engine, truncate: bool = False, **kwargs) -> None: |
| 52 | """ |
| 53 | :param engine: str |
| 54 | TextSynth API engine (e.g. `gptj_6B`) |
| 55 | :param truncate: bool |
| 56 | Truncate input if too long (if False and input is too long, throw error) |
| 57 | """ |
| 58 | super().__init__() |
| 59 | |
| 60 | self.engine = engine |
| 61 | self.truncate = truncate |
| 62 | self.api_url = "https://api.textsynth.com" |
| 63 | # Read from environment variable TEXTSYNTH_API_SECRET_KEY |
| 64 | self.api_key = os.environ["TEXTSYNTH_API_SECRET_KEY"] |
| 65 | |
| 66 | @property |
| 67 | def eot_token_id(self): |
nothing calls this directly
no outgoing calls
no test coverage detected