m-ric HF staff commited on
Commit
fb66618
1 Parent(s): 8cba28a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -2,6 +2,7 @@ import torch
2
  import spaces
3
  from transformers import AutoModelForCausalLM, AutoTokenizer
4
  import numpy as np
 
5
 
6
  print(f"Is CUDA available: {torch.cuda.is_available()}")
7
  # True
@@ -120,6 +121,7 @@ model = AutoModelForCausalLM.from_pretrained("gpt2")
120
 
121
  tokenizer.pad_token_id = tokenizer.eos_token_id
122
  print("Loading finished.")
 
123
  def generate_html(token, node):
124
  """Recursively generate HTML for the tree."""
125
 
@@ -220,8 +222,6 @@ def get_tables(input_text, number_steps, number_beams):
220
  )
221
  return tables
222
 
223
- import gradio as gr
224
-
225
  with gr.Blocks(
226
  theme=gr.themes.Soft(
227
  text_size="lg", font=["monospace"], primary_hue=gr.themes.colors.green
 
2
  import spaces
3
  from transformers import AutoModelForCausalLM, AutoTokenizer
4
  import numpy as np
5
+ import gradio as gr
6
 
7
  print(f"Is CUDA available: {torch.cuda.is_available()}")
8
  # True
 
121
 
122
  tokenizer.pad_token_id = tokenizer.eos_token_id
123
  print("Loading finished.")
124
+
125
  def generate_html(token, node):
126
  """Recursively generate HTML for the tree."""
127
 
 
222
  )
223
  return tables
224
 
 
 
225
  with gr.Blocks(
226
  theme=gr.themes.Soft(
227
  text_size="lg", font=["monospace"], primary_hue=gr.themes.colors.green