-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hf inference endpoint #18
Conversation
LOGAF Level 3 - /home/runner/work/GenossGPT/GenossGPT/demo/constants/model_configs.py This code is generally good, but there are areas for potential improvement. The Example: from contextlib import contextmanager
@contextmanager
def configured_openai(api_key, endpoint_url):
original_api_key = openai.api_key
original_api_base = openai.api_base
openai.api_key = api_key
openai.api_base = endpoint_url
try:
yield
finally:
openai.api_key = original_api_key
openai.api_base = original_api_base LOGAF Level 2 - /home/runner/work/GenossGPT/GenossGPT/genoss/api/embeddings_routes.py This code functions, but has significant issues needing attention. The Example: async def post_embeddings(model: str, input: str) -> list[float]:
if model not in SUPPORTED_MODELS:
raise NotImplementedError(f"Model {model} is not supported.")
gpt = SUPPORTED_MODELS[model]()
response = gpt.generate_embedding(input)
return response LOGAF Level 3 - /home/runner/work/GenossGPT/GenossGPT/genoss/entities/chat/chat_completion.py This code is generally good, but there are areas for potential improvement. The nested classes LOGAF Level 2 - /home/runner/work/GenossGPT/GenossGPT/genoss/llm/hf_hub/base_hf_hub.py This code functions, but has significant issues needing attention. The LOGAF Level 2 - /home/runner/work/GenossGPT/GenossGPT/genoss/services/model_factory.py This code functions, but has significant issues needing attention. The Example: MODEL_MAPPING = {
"gpt-4": OpenAILLM,
"gpt-3.5-turbo": OpenAILLM,
"gpt4all": Gpt4AllLLM,
# ...
}
def get_model_from_name(name: str, api_key: str | None = None) -> BaseGenossLLM | None:
model_class = MODEL_MAPPING.get(name.lower())
if model_class is None:
return None
return model_class(api_key=api_key) 🔄🔧📚 Powered by Code Review GPT |
No description provided.