|
52 | 52 | LOCAL_MODEL_KWARGS = {"device": LOCAL_EMBEDDINGS_DEVICE} |
53 | 53 | LOCAL_ENCODE_KWARGS = {"normalize_embeddings": False} |
54 | 54 |
|
55 | | -DEFAULT_TELL_ME_MODEL = "BAM" |
56 | | -SUPPORTED_TELL_ME_MODELS = ["BAM", "OPENAI", "OLLAMA"] |
| 55 | +DEFAULT_TELL_ME_MODEL = "OLLAMA" |
| 56 | +# SUPPORTED_TELL_ME_MODELS = ["BAM", "OPENAI", "OLLAMA"] |
| 57 | +SUPPORTED_TELL_ME_MODELS = ["BAM", "OLLAMA"] |
57 | 58 | OLLAMA_HOST = "http://0.0.0.0:11434" |
58 | 59 |
|
59 | 60 | try: |
|
83 | 84 |
|
84 | 85 | Answer the question based only on the following context: {context} Question: {question} """, |
85 | 86 | "settings": { |
86 | | - "temperature": 0.7, |
| 87 | + "temperature": 0.5, |
87 | 88 | "decoding_method": "greedy", |
88 | 89 | "max_new_tokens": 2048, |
89 | 90 | "min_new_tokens": 1, |
|
95 | 96 | }, |
96 | 97 | "OLLAMA": { |
97 | 98 | # "model": "granite-code:8b", |
98 | | - "model": "llama3", |
| 99 | + "model": "instructlab/granite-7b-lab", |
99 | 100 | "url": OLLAMA_HOST, |
100 | 101 | "template": """You are a technical documentation writer and when responding follow the following rules: |
101 | 102 | - Format All Command Syntax, Clauses, Examples or Option Syntax in codeblock ipython Markdown |
@@ -175,15 +176,15 @@ def get_tell_me_model(service: str, api_key: str): |
175 | 176 |
|
176 | 177 | return model, SUPPORTED_TELL_ME_MODELS_SETTINGS[service]["template"] |
177 | 178 | except Exception as e: # pylint: disable=broad-exception-caught |
178 | | - output_error("Error Loading OPENAI Model see error Messsage : \n" + e, return_val=False) |
| 179 | + output_error("Error Loading Model see error Messsage : \n" + e, return_val=False) |
179 | 180 | return None, None |
180 | 181 | elif service == "OLLAMA": |
181 | 182 | try: |
182 | 183 | model = ChatOllama(model=SUPPORTED_TELL_ME_MODELS_SETTINGS[service]["model"], base_url=OLLAMA_HOST) |
183 | 184 |
|
184 | 185 | return model, SUPPORTED_TELL_ME_MODELS_SETTINGS[service]["template"] |
185 | 186 | except Exception as e: # pylint: disable=broad-exception-caught |
186 | | - output_error("Error Loading OPENAI Model see error Messsage : \n" + e, return_val=False) |
| 187 | + output_error("Error Loading Model see error Messsage : \n" + e, return_val=False) |
187 | 188 | return None, None |
188 | 189 | elif service == "BAM": |
189 | 190 | creds = Credentials(api_key=api_key, api_endpoint=SUPPORTED_TELL_ME_MODELS_SETTINGS[service]["url"]) |
|
0 commit comments