Elffuss BraidHub

kikocis/llama-stack public

Allow TGI adaptor to have non-standard llama model names
Changeset554b5e3b4e616679bf245359acea02cba1d2f03abf1a676d37653acc0fff3448
AuthorHardik Shah <hjshah@fb.com> · 2024-09-19 21:36 -07:00
CommitterHardik Shah <hjshah@fb.com> · 2024-09-19 21:37 -07:00
Parents4191c822a68e

Browse the files at this changeset

1 file changed

modified llama_stack/providers/adapters/inference/tgi/tgi.py +0 −14
@@ -50,16 +50,6 @@
5050 raise RuntimeError("Missing max_total_tokens in model info")
5151 self.max_tokens = info["max_total_tokens"]
5252
53- model_id = info["model_id"]
54- model_name = next(
55- (name for name, id in HF_SUPPORTED_MODELS.items() if id == model_id),
56- None,
57- )
58- if model_name is None:
59- raise RuntimeError(
60- f"TGI is serving model: {model_id}, use one of the supported models: {', '.join(HF_SUPPORTED_MODELS.values())}"
61- )
62- self.model_name = model_name
6353 self.inference_url = info["inference_url"]
6454 except Exception as e:
6555 import traceback
@@ -116,10 +106,6 @@
116106
117107 print(f"Calculated max_new_tokens: {max_new_tokens}")
118108
119- assert (
120- request.model == self.model_name
121- ), f"Model mismatch, expected {self.model_name}, got {request.model}"
122-
123109 options = self.get_chat_options(request)
124110 if not request.stream:
125111 response = self.client.text_generation(