asoria HF staff commited on
Commit
5f46fb3
1 Parent(s): 7ca0dae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -6,7 +6,7 @@ from bertopic import BERTopic
6
  import pandas as pd
7
  import gradio as gr
8
  from bertopic.representation import KeyBERTInspired
9
-
10
 
11
  logging.basicConfig(
12
  level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
@@ -34,7 +34,7 @@ def get_docs_from_parquet(parquet_urls, column, offset, limit):
34
  logging.debug(f"Dataframe: {df.head(5)}")
35
  return df[column].tolist()
36
 
37
-
38
  def generate_topics(dataset, config, split, column, nested_column):
39
  logging.info(
40
  f"Generating topics for {dataset} with config {config} {split} {column} {nested_column}"
 
6
  import pandas as pd
7
  import gradio as gr
8
  from bertopic.representation import KeyBERTInspired
9
+ import spaces
10
 
11
  logging.basicConfig(
12
  level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
 
34
  logging.debug(f"Dataframe: {df.head(5)}")
35
  return df[column].tolist()
36
 
37
+ @spaces.GPU
38
  def generate_topics(dataset, config, split, column, nested_column):
39
  logging.info(
40
  f"Generating topics for {dataset} with config {config} {split} {column} {nested_column}"