samidh commited on
Commit
e771d98
·
verified ·
1 Parent(s): e31ed5e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1,4 +1,5 @@
1
  # This is a project of Chakra Lab LLC. All rights reserved.
 
2
 
3
  import gradio as gr
4
  import os
@@ -91,6 +92,7 @@ This policy is designed to determine whether or not content is hate speech.
91
  DEFAULT_CONTENT = "LLMs steal our jobs."
92
 
93
  # Function to make predictions
 
94
  def predict(content, policy):
95
  input_text = PROMPT.format(policy=policy, content=content)
96
  input_ids = tokenizer.encode(input_text, return_tensors="pt")
 
1
  # This is a project of Chakra Lab LLC. All rights reserved.
2
+ import spaces
3
 
4
  import gradio as gr
5
  import os
 
92
  DEFAULT_CONTENT = "LLMs steal our jobs."
93
 
94
  # Function to make predictions
95
+ @spaces.GPU
96
  def predict(content, policy):
97
  input_text = PROMPT.format(policy=policy, content=content)
98
  input_ids = tokenizer.encode(input_text, return_tensors="pt")