kgupta21 commited on
Commit
a956d76
·
1 Parent(s): 3dd738a

local inference page with fixes to gpu with zerogpu

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -11,6 +11,7 @@ from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer, TextIter
11
  from threading import Thread
12
  from typing import Iterator
13
  import os
 
14
 
15
  # Set up logging
16
  logging.basicConfig(level=logging.INFO)
@@ -110,6 +111,7 @@ def analyze_report(user_findings, ground_truth_findings, ground_truth_impression
110
  logger.error(f"Error in report analysis: {str(e)}")
111
  return f"Error analyzing report: {str(e)}"
112
 
 
113
  def transcribe(inputs, task="transcribe"):
114
  """Transcribe audio using Whisper"""
115
  if inputs is None:
@@ -125,6 +127,7 @@ def transcribe(inputs, task="transcribe"):
125
  logger.error(f"Error in transcription: {str(e)}")
126
  raise gr.Error(f"Transcription failed: {str(e)}")
127
 
 
128
  def analyze_with_llama(
129
  transcribed_text: str,
130
  ground_truth_findings: str,
 
11
  from threading import Thread
12
  from typing import Iterator
13
  import os
14
+ import spaces
15
 
16
  # Set up logging
17
  logging.basicConfig(level=logging.INFO)
 
111
  logger.error(f"Error in report analysis: {str(e)}")
112
  return f"Error analyzing report: {str(e)}"
113
 
114
+ @spaces.GPU
115
  def transcribe(inputs, task="transcribe"):
116
  """Transcribe audio using Whisper"""
117
  if inputs is None:
 
127
  logger.error(f"Error in transcription: {str(e)}")
128
  raise gr.Error(f"Transcription failed: {str(e)}")
129
 
130
+ @spaces.GPU
131
  def analyze_with_llama(
132
  transcribed_text: str,
133
  ground_truth_findings: str,