MaartenGr / MaartenGr/BERTopic
Can't update model name when use notebook
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.8k
- Forks
- 920
- Avg merge
- 22h 24m
- Merged PRs (30d)
- 5
Description
I have a quick question: I use openai embedding to generate the text-embedding. I found I couldn't update the model name unless I restart the jupyter kernal. But it's ok when I switch to python (not jupyter). Here is an example code
```
import openai
from bertopic.backend import OpenAIBackend
client = openai.OpenAI(api_key="sk-xxxxx")
embedding_model = OpenAIBackend(client, 'text-embedding-3-large')
print(embedding_model.embedding_model)
```
Here is screenshot from notebook and python:
notebook:
python script:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The reported entry point is bertopic.backend.OpenAIBackend, demonstrated in the notebook snippet; compare its behavior in Jupyter with the Python script case. Reproduce changing the model name without restarting the kernel, then verify that embedding_model reflects the selected name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100