mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-11 20:40:40 +00:00
refine
This commit is contained in:
parent
cb42e1d9d4
commit
3ca640be7f
3 changed files with 7 additions and 16 deletions
|
@ -545,7 +545,6 @@ class ChatAgent(ShieldRunnerMixin):
|
||||||
)
|
)
|
||||||
|
|
||||||
elif delta.type == "text":
|
elif delta.type == "text":
|
||||||
# delta.text = "hello"
|
|
||||||
content += delta.text
|
content += delta.text
|
||||||
if stream and event.stop_reason is None:
|
if stream and event.stop_reason is None:
|
||||||
yield AgentTurnResponseStreamChunk(
|
yield AgentTurnResponseStreamChunk(
|
||||||
|
|
|
@ -94,7 +94,7 @@ class PassthroughInferenceAdapter(Inference):
|
||||||
client = self._get_client()
|
client = self._get_client()
|
||||||
model = await self.model_store.get_model(model_id)
|
model = await self.model_store.get_model(model_id)
|
||||||
|
|
||||||
params = {
|
request_params = {
|
||||||
"model_id": model.provider_resource_id,
|
"model_id": model.provider_resource_id,
|
||||||
"content": content,
|
"content": content,
|
||||||
"sampling_params": sampling_params,
|
"sampling_params": sampling_params,
|
||||||
|
@ -103,10 +103,13 @@ class PassthroughInferenceAdapter(Inference):
|
||||||
"logprobs": logprobs,
|
"logprobs": logprobs,
|
||||||
}
|
}
|
||||||
|
|
||||||
params = {key: value for key, value in params.items() if value is not None}
|
request_params = {key: value for key, value in request_params.items() if value is not None}
|
||||||
|
|
||||||
|
# cast everything to json dict
|
||||||
|
json_params = self.cast_value_to_json_dict(request_params)
|
||||||
|
|
||||||
# only pass through the not None params
|
# only pass through the not None params
|
||||||
return await client.inference.completion(**params)
|
return await client.inference.completion(**json_params)
|
||||||
|
|
||||||
async def chat_completion(
|
async def chat_completion(
|
||||||
self,
|
self,
|
||||||
|
|
|
@ -20,13 +20,6 @@ providers:
|
||||||
- provider_id: sentence-transformers
|
- provider_id: sentence-transformers
|
||||||
provider_type: inline::sentence-transformers
|
provider_type: inline::sentence-transformers
|
||||||
config: {}
|
config: {}
|
||||||
- provider_id: meta-reference-inference
|
|
||||||
provider_type: inline::meta-reference
|
|
||||||
config:
|
|
||||||
model: meta-llama/Llama-Guard-3-1B
|
|
||||||
max_seq_len: 4096
|
|
||||||
checkpoint_dir: ${env.INFERENCE_CHECKPOINT_DIR:null}
|
|
||||||
# api_key: ${env.TOGETHER_API_KEY}
|
|
||||||
vector_io:
|
vector_io:
|
||||||
- provider_id: faiss
|
- provider_id: faiss
|
||||||
provider_type: inline::faiss
|
provider_type: inline::faiss
|
||||||
|
@ -110,12 +103,8 @@ models:
|
||||||
provider_id: passthrough
|
provider_id: passthrough
|
||||||
provider_model_id: llama3.2-11b-vision-instruct
|
provider_model_id: llama3.2-11b-vision-instruct
|
||||||
model_type: llm
|
model_type: llm
|
||||||
- metadata: {}
|
|
||||||
model_id: meta-llama/Llama-Guard-3-1B
|
|
||||||
provider_id: meta-reference-inference
|
|
||||||
model_type: llm
|
|
||||||
shields:
|
shields:
|
||||||
- shield_id: meta-llama/Llama-Guard-3-1B
|
- shield_id: meta-llama/Llama-Guard-3-8B
|
||||||
vector_dbs: []
|
vector_dbs: []
|
||||||
datasets: []
|
datasets: []
|
||||||
scoring_fns: []
|
scoring_fns: []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue