Etash Guha commited on
Commit
6055e2f
1 Parent(s): 32bc229
Files changed (1) hide show
  1. generators/model.py +8 -10
generators/model.py CHANGED
@@ -126,26 +126,24 @@ class Samba():
126
 
127
  for i in range(num_comps):
128
  payload = {
129
- "inputs": [dataclasses.asdict(message) for message in messages],
130
  "params": {
131
- "do_sample": {"type": "bool", "value": True},
132
  "max_tokens_allowed_in_completion": {"type": "int", "value": 500},
133
  "min_token_capacity_for_completion": {"type": "int", "value": 2},
134
- "temperature": {"type": "float", "value": 0.7},
135
- "top_p": {"type": "float", "value": 0.1},
136
- "top_k": {"type": "int", "value": 40},
137
  "skip_special_token": {"type": "bool", "value": True},
138
- "repetition_penalty": {"type": "float", "value": 1.15},
139
  "stop_sequences": {"type": "list", "value": ["[INST]", "[INST]", "[/INST]", "[/INST]"]}
140
  },
141
- "expert": "llama3-8b"
142
  }
143
- url = 'https://kjddazcq2e2wzvzv.snova.ai/api/v1/chat/completion'
 
 
144
  headers = {
145
- "Authorization": "Basic bGlnaHRuaW5nOlUyM3pMcFlHY3dmVzRzUGFy",
146
  "Content-Type": "application/json"
147
  }
148
- post_response = requests.post(url, json=payload, headers=headers, stream=True)
 
149
  response_text = ""
150
  for line in post_response.iter_lines():
151
  if line.startswith(b"data: "):
 
126
 
127
  for i in range(num_comps):
128
  payload = {
129
+ "inputs": messages,
130
  "params": {
 
131
  "max_tokens_allowed_in_completion": {"type": "int", "value": 500},
132
  "min_token_capacity_for_completion": {"type": "int", "value": 2},
 
 
 
133
  "skip_special_token": {"type": "bool", "value": True},
 
134
  "stop_sequences": {"type": "list", "value": ["[INST]", "[INST]", "[/INST]", "[/INST]"]}
135
  },
136
+ "model": "llama3-8b"
137
  }
138
+ url = "kjddazcq2e2wzvzv.snova.ai"
139
+ key = "bGlnaHRuaW5nOlUyM3pMcFlHY3dmVzRzUGFy"
140
+
141
  headers = {
142
+ "Authorization": f"Basic {key}",
143
  "Content-Type": "application/json"
144
  }
145
+ post_response = requests.post(f'https://{url}/api/v1/chat/completion', json=payload, headers=headers, stream=True)
146
+
147
  response_text = ""
148
  for line in post_response.iter_lines():
149
  if line.startswith(b"data: "):