minhdang commited on
Commit
8666022
·
verified ·
1 Parent(s): 4c43d2f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -3,6 +3,7 @@ import gradio as gr
3
  import transformers
4
  from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
5
  import torch
 
6
 
7
  title = """
8
  # Welcome to 🌟Tonic's🫡Command-R
@@ -24,6 +25,7 @@ model = AutoModelForCausalLM.from_pretrained(model_id, quantization_config=bnb_c
24
 
25
  @spaces.GPU
26
  def generate_response(user_input, max_new_tokens, temperature):
 
27
  messages = [{"role": "user", "content": user_input}]
28
  input_ids = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
29
  input_ids = input_ids.to(model.device)
 
3
  import transformers
4
  from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
5
  import torch
6
+ import os
7
 
8
  title = """
9
  # Welcome to 🌟Tonic's🫡Command-R
 
25
 
26
  @spaces.GPU
27
  def generate_response(user_input, max_new_tokens, temperature):
28
+ os.system('nvidia-smi')
29
  messages = [{"role": "user", "content": user_input}]
30
  input_ids = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
31
  input_ids = input_ids.to(model.device)