Skip to content

feat: add refactoring of default temperature #529

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

Merged
merged 1 commit into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/local_models/smart_scraper_ollama.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"format": "json", # Ollama needs the format to be specified explicitly
# "base_url": "http://localhost:11434", # set ollama URL arbitrarily
},

"verbose": True,
"headless": False
}
Expand Down
7 changes: 5 additions & 2 deletions scrapegraphai/graphs/abstract_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class AbstractGraph(ABC):
def __init__(self, prompt: str, config: dict,
source: Optional[str] = None, schema: Optional[BaseModel] = None):

if config.get("llm").get("temperature") is None:
config["llm"]["temperature"] = 0

self.prompt = prompt
self.source = source
self.config = config
Expand Down Expand Up @@ -212,7 +215,7 @@ def handle_model(model_name, provider, token_key, default_token=8192):
print("model not found, using default token size (8192)")
self.model_token = 8192
return ErnieBotChat(llm_params)

if "oneapi" in llm_params["model"]:
# take the model after the last dash
llm_params["model"] = llm_params["model"].split("/")[-1]
Expand All @@ -221,7 +224,7 @@ def handle_model(model_name, provider, token_key, default_token=8192):
except KeyError as exc:
raise KeyError("Model not supported") from exc
return OneApi(llm_params)

if "nvidia" in llm_params["model"]:
try:
self.model_token = models_tokens["nvidia"][llm_params["model"].split("/")[-1]]
Expand Down
Loading