tmzh commited on
Commit
71ecf90
1 Parent(s): db20734
Files changed (2) hide show
  1. app.py +3 -0
  2. requirements.txt +2 -1
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import base64
2
  import io
3
  import math
@@ -82,6 +83,7 @@ def create_random_word_groups(clues: List[Tuple[List[str], str, str]], target_gr
82
  groups.append((merged_words, selected_indices))
83
  return groups
84
 
 
85
  def group_words(word_list: List[str]) -> List[Group]:
86
  """
87
  Groups the given words into 3 to 4 thematic groups.
@@ -130,6 +132,7 @@ def group_words(word_list: List[str]) -> List[Group]:
130
  print(f"Generated groupings: {generations}")
131
  return generations.groups
132
 
 
133
  def generate_clue(group: List[str]) -> Clue:
134
  """
135
  Generates a single-word clue for the given group of words.
 
1
+ import spaces
2
  import base64
3
  import io
4
  import math
 
83
  groups.append((merged_words, selected_indices))
84
  return groups
85
 
86
+ @spaces.GPU(duration=120)
87
  def group_words(word_list: List[str]) -> List[Group]:
88
  """
89
  Groups the given words into 3 to 4 thematic groups.
 
132
  print(f"Generated groupings: {generations}")
133
  return generations.groups
134
 
135
+ @spaces.GPU(duration=120)
136
  def generate_clue(group: List[str]) -> Clue:
137
  """
138
  Generates a single-word clue for the given group of words.
requirements.txt CHANGED
@@ -1 +1,2 @@
1
- outlines
 
 
1
+ outlines
2
+ transformers