Skip to content

Add a notebook with BakLLaVA inference from Python - #6

Open
kopyl wants to merge 1 commit into
SkunkworksAI:mainfrom
kopyl:bakllava-notebook
Open

Add a notebook with BakLLaVA inference from Python#6
kopyl wants to merge 1 commit into
SkunkworksAI:mainfrom
kopyl:bakllava-notebook

Conversation

@kopyl

@kopyl kopyl commented Oct 20, 2023

Copy link
Copy Markdown

Also add notebooks directory in the root of this repo

@kopyl

kopyl commented Oct 20, 2023

Copy link
Copy Markdown
Author

You can preview the notebook here: https://colab.research.google.com/drive/1yn-25Np_6OiJ7IDBBcuPOsPF9vqWBjzt

@nisten
@Sentdex
@pharaouk
@marianna13

Guys, could you please review and merge?

@mshumer

mshumer commented Nov 17, 2023

Copy link
Copy Markdown

Hey @kopyl, I'm having trouble with the notebook -- getting this error when running the last cell:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-9-b3405b5fe08b> in <cell line: 1>()
      1 with torch.inference_mode():
----> 2     output_ids = model.generate(
      3         input_ids=input_ids,
      4         images=image_tensor,
      5         do_sample=True,

2 frames
/usr/local/lib/python3.10/dist-packages/transformers/generation/utils.py in sample(self, input_ids, logits_processor, stopping_criteria, logits_warper, max_length, pad_token_id, eos_token_id, output_attentions, output_hidden_states, output_scores, return_dict_in_generate, synced_gpus, streamer, **model_kwargs)
   2768             # sample
   2769             probs = nn.functional.softmax(next_token_scores, dim=-1)
-> 2770             next_tokens = torch.multinomial(probs, num_samples=1).squeeze(1)
   2771 
   2772             # finished sentences should have their next token be a padding token

RuntimeError: probability tensor contains either `inf`, `nan` or element < 0

Any ideas as to how this can be fixed?

@kopyl

kopyl commented Nov 17, 2023

Copy link
Copy Markdown
Author

@mshumer try Runpod. Google Colab sometimes has issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants