Skip to content

Commit

Permalink
quick fix to get model given from UI
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartManoj committed Sep 4, 2024
1 parent 3e15ff4 commit d229664
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions openhands/core/config2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
model = 'groq/llama3-8b-8192'
5 changes: 4 additions & 1 deletion openhands/core/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ def contains_image(self) -> bool:
@model_serializer
def serialize_model(self) -> dict:
content: list[dict[str, str | dict[str, str]]] = []
model = config.get_llm_config().model
import openhands.core.config2 as config2

model = config2.model
supports_vision = litellm.supports_vision(model)

if not supports_vision:
text_contents = '\n'.join([item.text for item in self.content])
return {'role': self.role, 'content': text_contents}
Expand Down
3 changes: 3 additions & 0 deletions openhands/server/session/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ async def _initialize_agent(self, data: dict):
default_llm_config.model = args.get(
ConfigType.LLM_MODEL, default_llm_config.model
)
import openhands.core.config2 as config2

config2.model = default_llm_config.model
default_llm_config.api_key = args.get(
ConfigType.LLM_API_KEY, default_llm_config.api_key
)
Expand Down

0 comments on commit d229664

Please sign in to comment.