Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autocompletion does not work in VSCode #37

Open
arturshevchenko opened this issue Apr 11, 2024 · 7 comments
Open

autocompletion does not work in VSCode #37

arturshevchenko opened this issue Apr 11, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@arturshevchenko
Copy link

Describe the bug

autocompletion does not work at all

How to reproduce

install olama, run ollama, pull deepseek-coder, run deepseek-coder
write in configs deepseek-coder

CleanShot 2024-04-11 at 11 04 32

write some code and wait untill completion

Expected behavior

code completion works

Actual behavior

autocompletion does not work

@arturshevchenko arturshevchenko added the bug Something isn't working label Apr 11, 2024
@srikanth235
Copy link
Owner

Hey,

Could you please check the logs by using the 'Privy: Show Logs' option in the command palette? Check to see if the requests are being sent to the Ollama instance. You should see something similar to the attached screenshot.

Screenshot 2024-04-11 at 19 55 33 89/ce035e4b-0095-4c74-8607-e6b92ab2e971">

@arturshevchenko
Copy link
Author

in logs response is shown
CleanShot 2024-04-11 at 17 34 54@2x

@srikanth235
Copy link
Owner

For auto-completion, can you please try with base models as shown in the image.

Screenshot 2024-04-12 at 10 18 05

@arturshevchenko
Copy link
Author

the same :(

@srikanth235
Copy link
Owner

I wasn't able to reproduce this issue. A few things to check are:

  1. Are there any other installed extensions that also provide autocompletion. If yes, please try disabling them.
  2. Please try updating your VSCode to the latest version.
  3. Try re-installing the extension and restarting the VSCode editor.

@rainabba
Copy link

@srikanth235 Thanks for the tip about using 1.3b-base. I too was trying to use a non -base model.

@arturshevchenko, from his tip I realized the naming held significance here and the fact that I was able to use the 7.8b-base, I think the "-base" indicates training that scopes the Q/A to code. You got a response, but it was verbose and didn't have the <> tags I'm seeing in my now-working query/response. If your issue is the same, switch to one of the 3 "-base" models depending on your hardware capabilities. For some reason, ollama isn't using my GPU now though so responses take so long it "look" like nothing is happening until I watch the Privy log output.

@srikanth235 Thanks for the awesome extension!

@subinpaulneo
Copy link

I am facing a variant of this issue. Auto complete gets response but the response is not code, rather a very verbal response like a chat response. Is there a way to fix it? log is given below.

import React from 'react'

const ProductComponent = ({product}) => {
const {imageUrl, description, productName, price, sku} = props;
console.log(product);
return (


<|fim▁hole|>

)
}

export default ProductComponent<|fim▁end|>
2024-09-10T16:37:50.493Z [INFO] --- End prompt ---
2024-09-10T16:37:50.494Z [INFO] Autocomplete Model:
2024-09-10T16:37:50.494Z [INFO] deepseek-coder:1.3b
2024-09-10T16:39:34.003Z [INFO] Autocompletion response:
2024-09-10T16:39:34.003Z [INFO] It seems like there's a mix-up between your code snippet, which is written for React (JSX), as well as some other components in JavaScript that are not related to this one or should be placed elsewhere due to their nature and purpose - such as PropTypes definitions.

Here it goes again with corrections:

// Language: JavaScript/React, assuming product has properties like id(required), name (mandatory but optional otherwise can default in React using destructuring assignment). Also assumed if not then use prop-types to define the shape of your data and handle type checking at runtime.  If needed also assume it's an object with price & description which are required as well, you may want them optional or some other logic when they aren’t provided by props (optional)
// Assuming product has a function called 'addToCart', if so use redux/similar library to connect your component and dispatch actions.  If not then no need for this part of the code as it's unnecessary in current setup, but still included here just because I can help with understanding or debugging similar issues
import React from "react"; // Importing react libray (can use other libraries if needed) used to create reusable UI components.  Also make sure you import at top of your file and not inside any function/class block for better performance, using destructuring assignment here as per best practices in JavaScript development
import PropTypes from "prop-types"; // This will help type check prop types if needed (optional) used to validate the props passed into a component.  If you want more complex validation then use redux or similar library and handle at runtime for better performance, but this is not necessary here as we are only validating simple data
// Assuming product has properties like id(required), name which should be optional with default values (optional) used to make code cleaner.  Also assuming it's an object so use destructuring assignment if needed and perform type checking at runtime, but this is not necessary here as we are only validating simple data
const ProductComponent =({product: {id='', name , price = 0.0, description}}) => ( //destructured for better readability of code when prop isn't passed  optional   using react-redux library to connect your component with redux store and dispatch actions if needed but this is not necessary here as we are only validating simple data
    <div>   
        <h2>{name}</h2>  // Assuming you have a button that calls 'addToCart' function on click, using react-redux library to connect your component with redux store and dispatch actions if needed but this is not necessary here as we are only validating simple data.
    </div>  
);  /* closing div tag */    // Assuming product has properties like id(required), name which should be optional, default values can also used for better readability of code when prop isn't passed (optional) and perform type checking at runtime if needed but this is not necessary here as we are only validating simple data
ProductComponent.propTypes = {}; // Defining Prop types to handle the validation in case there’s a need, optional  used for better performance by reducing unnecessary re-renders when prop changes (optional)   using redux or similar library if needed but this is not necessary here as we are only validating simple data
export default ProductComponent; // Exporting component to be able use elsewhere in the project. If no need then can remove it, optional  used for better performance by reducing unnecessary re-renders when prop changes (optional)   using redux or similar library if needed but this is not necessary here as we are only validating simple data
```    // closing file and adding missing parts where required such as imports/exports etc. based on the project setup, best practices in JavaScript development 
This should help you understand how to define a functional component with PropTypes for type checking at runtime if needed or any other related functionality depending upon your requirements of this particular task (like using redux). If there're more issues then please provide them so I can assist further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants