davidmezzetti commited on
Commit
c421bc7
1 Parent(s): 0949b1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -10
app.py CHANGED
@@ -13,7 +13,7 @@ import pandas as pd
13
  import streamlit as st
14
 
15
  from txtai.embeddings import Documents, Embeddings
16
- from txtai.pipeline import Segmentation, Summary, Tabular, Transcription, Translation
17
  from txtai.workflow import ServiceTask, Task, UrlTask, Workflow
18
 
19
 
@@ -121,10 +121,6 @@ class Application:
121
  if options["textcolumns"]:
122
  options["textcolumns"] = self.split(options["textcolumns"])
123
 
124
- elif component == "transcribe":
125
- st.sidebar.markdown("**Transcribe** \n*Transcribe audio to text*")
126
- options["path"] = st.sidebar.text_input("Model", value="facebook/wav2vec2-base-960h")
127
-
128
  elif component == "translate":
129
  st.sidebar.markdown("**Translate** \n*Machine translation*")
130
  options["target"] = st.sidebar.text_input("Target language code", value="en")
@@ -169,10 +165,6 @@ class Application:
169
  self.pipelines[wtype] = Tabular(**self.components["tabular"])
170
  tasks.append(Task(self.pipelines["tabular"]))
171
 
172
- elif wtype == "transcribe":
173
- self.pipelines[wtype] = Transcription(component.pop("path"))
174
- tasks.append(UrlTask(self.pipelines["transcribe"], r".\.wav$"))
175
-
176
  elif wtype == "translate":
177
  self.pipelines[wtype] = Translation()
178
  tasks.append(Task(lambda x: self.pipelines["translate"](x, **self.components["translate"])))
@@ -271,7 +263,7 @@ class Application:
271
  st.sidebar.markdown("# Workflow builder \n*Build and apply workflows to data* \n[GitHub](https://github.com/neuml/txtai) ")
272
 
273
  # Get selected components
274
- components = ["embeddings", "segment", "service", "summary", "tabular", "transcribe", "translate"]
275
  selected = st.sidebar.multiselect("Select components", components)
276
 
277
  # Get selected options
 
13
  import streamlit as st
14
 
15
  from txtai.embeddings import Documents, Embeddings
16
+ from txtai.pipeline import Segmentation, Summary, Tabular, Translation
17
  from txtai.workflow import ServiceTask, Task, UrlTask, Workflow
18
 
19
 
 
121
  if options["textcolumns"]:
122
  options["textcolumns"] = self.split(options["textcolumns"])
123
 
 
 
 
 
124
  elif component == "translate":
125
  st.sidebar.markdown("**Translate** \n*Machine translation*")
126
  options["target"] = st.sidebar.text_input("Target language code", value="en")
 
165
  self.pipelines[wtype] = Tabular(**self.components["tabular"])
166
  tasks.append(Task(self.pipelines["tabular"]))
167
 
 
 
 
 
168
  elif wtype == "translate":
169
  self.pipelines[wtype] = Translation()
170
  tasks.append(Task(lambda x: self.pipelines["translate"](x, **self.components["translate"])))
 
263
  st.sidebar.markdown("# Workflow builder \n*Build and apply workflows to data* \n[GitHub](https://github.com/neuml/txtai) ")
264
 
265
  # Get selected components
266
+ components = ["embeddings", "segment", "service", "summary", "tabular", "translate"]
267
  selected = st.sidebar.multiselect("Select components", components)
268
 
269
  # Get selected options