dependencies delete aha_openai_dive,chrono
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use aha_openai_dive::v1::resources::chat::{
|
||||
use crate::params::chat::{
|
||||
ChatCompletionChunkResponse, ChatCompletionParameters, ChatCompletionResponse,
|
||||
};
|
||||
use anyhow::{Result, anyhow};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use aha_openai_dive::v1::resources::chat::ChatCompletionParameters;
|
||||
use crate::params::chat::ChatCompletionParameters;
|
||||
use anyhow::Result;
|
||||
use candle_core::{DType, Device, Tensor};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use aha_openai_dive::v1::resources::chat::{
|
||||
use crate::params::chat::{
|
||||
ChatCompletionChunkResponse, ChatCompletionParameters, ChatCompletionResponse,
|
||||
};
|
||||
use anyhow::{Result, anyhow};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use aha_openai_dive::v1::resources::chat::ChatCompletionParameters;
|
||||
use crate::params::chat::ChatCompletionParameters;
|
||||
use anyhow::Result;
|
||||
use candle_core::{D, Device, Tensor};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use aha_openai_dive::v1::resources::chat::{
|
||||
use crate::params::chat::{
|
||||
ChatCompletionChunkResponse, ChatCompletionParameters, ChatCompletionResponse,
|
||||
};
|
||||
use anyhow::{Result, anyhow};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use aha_openai_dive::v1::resources::chat::ChatCompletionParameters;
|
||||
use crate::params::chat::ChatCompletionParameters;
|
||||
use anyhow::Result;
|
||||
use candle_core::{D, DType, Device, IndexOp, Tensor};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! GLM-OCR Inference and Generation
|
||||
use aha_openai_dive::v1::resources::chat::{
|
||||
use crate::params::chat::{
|
||||
ChatCompletionChunkResponse, ChatCompletionParameters, ChatCompletionResponse,
|
||||
};
|
||||
use anyhow::{Result, anyhow};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use aha_openai_dive::v1::resources::chat::{
|
||||
use crate::params::chat::{
|
||||
ChatCompletionChunkResponse, ChatCompletionParameters, ChatCompletionResponse,
|
||||
};
|
||||
use anyhow::{Result, anyhow};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use aha_openai_dive::v1::resources::chat::ChatCompletionParameters;
|
||||
use crate::params::chat::ChatCompletionParameters;
|
||||
use anyhow::Result;
|
||||
use candle_core::{DType, Device, IndexOp, Shape, Tensor};
|
||||
use image::DynamicImage;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use crate::params::chat::{ChatCompletionParameters, ChatCompletionResponse};
|
||||
use crate::utils::build_completion_chunk_response;
|
||||
use crate::{
|
||||
chat_template::ChatTemplate,
|
||||
@@ -13,7 +14,6 @@ use crate::{
|
||||
build_completion_response, find_type_files, get_device, get_dtype, get_logit_processor,
|
||||
},
|
||||
};
|
||||
use aha_openai_dive::v1::resources::chat::{ChatCompletionParameters, ChatCompletionResponse};
|
||||
use anyhow::Result;
|
||||
use candle_core::{DType, Device, Tensor};
|
||||
use candle_nn::VarBuilder;
|
||||
@@ -109,10 +109,7 @@ impl<'a> GenerateModel for Lfm2GenerateModel<'a> {
|
||||
) -> Result<
|
||||
Box<
|
||||
dyn rocket::futures::Stream<
|
||||
Item = Result<
|
||||
aha_openai_dive::v1::resources::chat::ChatCompletionChunkResponse,
|
||||
anyhow::Error,
|
||||
>,
|
||||
Item = Result<crate::params::chat::ChatCompletionChunkResponse, anyhow::Error>,
|
||||
> + Send
|
||||
+ Unpin
|
||||
+ '_,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use aha_openai_dive::v1::resources::chat::{ChatCompletionParameters, ChatCompletionResponse};
|
||||
use crate::params::chat::{ChatCompletionParameters, ChatCompletionResponse};
|
||||
use anyhow::Result;
|
||||
use candle_core::{DType, Device, Tensor};
|
||||
use candle_nn::VarBuilder;
|
||||
@@ -119,10 +119,7 @@ impl<'a> GenerateModel for Lfm2VLGenerateModel<'a> {
|
||||
) -> Result<
|
||||
Box<
|
||||
dyn rocket::futures::Stream<
|
||||
Item = Result<
|
||||
aha_openai_dive::v1::resources::chat::ChatCompletionChunkResponse,
|
||||
anyhow::Error,
|
||||
>,
|
||||
Item = Result<crate::params::chat::ChatCompletionChunkResponse, anyhow::Error>,
|
||||
> + Send
|
||||
+ Unpin
|
||||
+ '_,
|
||||
|
||||
@@ -287,7 +287,6 @@ impl Lfm2VLModel {
|
||||
&& let Some(shapes) = spatial_shapes
|
||||
{
|
||||
let image_embeds = self.vision_tower.forward(pixel, mask, shapes)?;
|
||||
println!("image_embeds: {}", image_embeds);
|
||||
let bs = image_embeds.dim(0)?;
|
||||
let img_featrure_length = mask.sum(1)?.to_vec1::<u32>()?;
|
||||
let mut image_features = vec![];
|
||||
@@ -306,7 +305,6 @@ impl Lfm2VLModel {
|
||||
image_features.push(img_embedding);
|
||||
}
|
||||
let image_embeds = Tensor::cat(&image_features, 0)?;
|
||||
println!("image_embeds: {}", image_embeds);
|
||||
let image_mask = get_equal_mask(input_ids, self.img_id)?;
|
||||
inputs_embeds = masked_scatter_dim0(&inputs_embeds, &image_embeds, &image_mask)?;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use crate::params::chat::ChatCompletionParameters;
|
||||
use crate::{
|
||||
models::lfm2vl::config::{Lfm2ImageConfig, Lfm2ProcessorConfig},
|
||||
utils::{
|
||||
@@ -8,7 +9,6 @@ use crate::{
|
||||
round_by_factor,
|
||||
},
|
||||
};
|
||||
use aha_openai_dive::v1::resources::chat::ChatCompletionParameters;
|
||||
use anyhow::Result;
|
||||
use candle_core::{DType, Device, Tensor};
|
||||
use image::DynamicImage;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use aha_openai_dive::v1::resources::chat::{
|
||||
use crate::params::chat::{
|
||||
ChatCompletionChunkResponse, ChatCompletionParameters, ChatCompletionResponse,
|
||||
};
|
||||
use anyhow::{Result, anyhow};
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ pub mod rmbg2_0;
|
||||
pub mod voxcpm;
|
||||
pub mod w2v_bert_2_0;
|
||||
|
||||
use aha_openai_dive::v1::resources::chat::{
|
||||
use crate::params::chat::{
|
||||
ChatCompletionChunkResponse, ChatCompletionParameters, ChatCompletionResponse,
|
||||
};
|
||||
use anyhow::{Result, anyhow};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use aha_openai_dive::v1::resources::chat::{
|
||||
use crate::params::chat::{
|
||||
ChatCompletionChunkResponse, ChatCompletionParameters, ChatCompletionResponse,
|
||||
};
|
||||
use anyhow::{Result, anyhow};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use aha_openai_dive::v1::resources::chat::ChatCompletionParameters;
|
||||
use crate::params::chat::ChatCompletionParameters;
|
||||
use anyhow::Result;
|
||||
use candle_core::{DType, Device, IndexOp, Shape, Tensor};
|
||||
use image::DynamicImage;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use aha_openai_dive::v1::resources::chat::{
|
||||
use crate::params::chat::{
|
||||
ChatCompletionChunkResponse, ChatCompletionParameters, ChatCompletionResponse,
|
||||
};
|
||||
use anyhow::{Result, anyhow};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use aha_openai_dive::v1::resources::chat::{
|
||||
use crate::params::chat::{
|
||||
ChatCompletionParameters, ChatMessage, ChatMessageContent, ChatMessageContentPart,
|
||||
};
|
||||
use anyhow::{Result, anyhow};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use aha_openai_dive::v1::resources::chat::{
|
||||
use crate::params::chat::{
|
||||
ChatCompletionChunkResponse, ChatCompletionParameters, ChatCompletionResponse,
|
||||
};
|
||||
use anyhow::{Result, anyhow};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use aha_openai_dive::v1::resources::chat::{
|
||||
use crate::params::chat::{
|
||||
ChatCompletionChunkResponse, ChatCompletionParameters, ChatCompletionResponse,
|
||||
};
|
||||
use anyhow::{Result, anyhow};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use aha_openai_dive::v1::resources::chat::{
|
||||
use crate::params::chat::{
|
||||
ChatCompletionChunkResponse, ChatCompletionParameters, ChatCompletionResponse,
|
||||
};
|
||||
use anyhow::{Result, anyhow};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use aha_openai_dive::v1::resources::chat::ChatCompletionParameters;
|
||||
use crate::params::chat::ChatCompletionParameters;
|
||||
use anyhow::Result;
|
||||
use candle_core::{Device, Tensor};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use aha_openai_dive::v1::resources::chat::{
|
||||
use crate::params::chat::{
|
||||
ChatCompletionChunkResponse, ChatCompletionParameters, ChatCompletionResponse,
|
||||
};
|
||||
use anyhow::{Result, anyhow};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use aha_openai_dive::v1::resources::chat::{
|
||||
use crate::params::chat::{
|
||||
ChatCompletionParameters, ChatMessage, ChatMessageContent, ChatMessageContentPart,
|
||||
};
|
||||
use anyhow::Result;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use std::io::Cursor;
|
||||
|
||||
use aha_openai_dive::v1::resources::chat::{
|
||||
use crate::params::chat::{
|
||||
ChatCompletionChunkResponse, ChatCompletionParameters, ChatCompletionResponse,
|
||||
};
|
||||
use anyhow::Result;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use aha_openai_dive::v1::resources::chat::{
|
||||
use crate::params::chat::{
|
||||
ChatCompletionChunkResponse, ChatCompletionParameters, ChatCompletionResponse,
|
||||
};
|
||||
use anyhow::{Ok, Result};
|
||||
|
||||
Reference in New Issue
Block a user