fixed truncation error in fake language model
This commit is contained in:
parent
3447a9478c
commit
ca82ec8e8e
4 changed files with 10 additions and 3 deletions
|
@ -69,7 +69,7 @@ impl EmbeddingQueue {
|
|||
}
|
||||
|
||||
pub fn set_credential(&mut self, credential: ProviderCredential) {
|
||||
self.provider_credential = credential
|
||||
self.provider_credential = credential;
|
||||
}
|
||||
|
||||
pub fn push(&mut self, file: FileToEmbed) {
|
||||
|
|
|
@ -291,7 +291,6 @@ impl SemanticIndex {
|
|||
}
|
||||
|
||||
self.embedding_queue.lock().set_credential(credential);
|
||||
|
||||
self.is_authenticated()
|
||||
}
|
||||
|
||||
|
@ -299,6 +298,7 @@ impl SemanticIndex {
|
|||
let credential = &self.provider_credential;
|
||||
match credential {
|
||||
&ProviderCredential::Credentials { .. } => true,
|
||||
&ProviderCredential::NotNeeded => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
@ -1020,11 +1020,14 @@ impl SemanticIndex {
|
|||
cx: &mut ModelContext<Self>,
|
||||
) -> Task<Result<()>> {
|
||||
if !self.is_authenticated() {
|
||||
println!("Authenticating");
|
||||
if !self.authenticate(cx) {
|
||||
return Task::ready(Err(anyhow!("user is not authenticated")));
|
||||
}
|
||||
}
|
||||
|
||||
println!("SHOULD NOW BE AUTHENTICATED");
|
||||
|
||||
if !self.projects.contains_key(&project.downgrade()) {
|
||||
let subscription = cx.subscribe(&project, |this, project, event, cx| match event {
|
||||
project::Event::WorktreeAdded | project::Event::WorktreeRemoved(_) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue