Skip to content

Commit

Permalink
remove sharded_transcribe and simplify POST requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert M Ochshorn authored and Robert M Ochshorn committed May 26, 2016
1 parent de26d56 commit f3f351f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 67 deletions.
60 changes: 0 additions & 60 deletions examples/sharded_transcribe.py

This file was deleted.

10 changes: 3 additions & 7 deletions serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@

import json
import logging
import math
import multiprocessing
from multiprocessing.pool import ThreadPool as Pool
import os
from Queue import Queue
import shutil
import subprocess
import sys
import uuid
import wave

from gentle.paths import get_binary, get_resource, get_datadir
from gentle.paths import get_resource, get_datadir
from gentle.transcription import to_csv, MultiThreadedTranscriber
from gentle.cyst import Insist
from gentle.ffmpeg import to_wav
Expand Down Expand Up @@ -206,7 +202,7 @@ def getChild(self, uid, req):
def render_POST(self, req):
uid = self.transcriber.next_id()

tran = req.args['transcript'][0]
tran = req.args.get('transcript', [''])[0]
audio = req.args['audio'][0]

async = True
Expand All @@ -230,7 +226,7 @@ def render_POST(self, req):
if not async:
def write_result(result):
'''Write JSON to client on completion'''
req.headers["Content-Type"] = "application/json"
req.setHeader("Content-Type", "application/json")
req.write(json.dumps(result, indent=2))
req.finish()
result_promise.addCallback(write_result)
Expand Down

0 comments on commit f3f351f

Please sign in to comment.