Whisper Open Ai Got Stuck - openai-whisper

import whisper
import os
model = whisper.load_model("medium")
print("Sarted")
result = model.transcribe(os.path.join("samples","speech.mp3"),fp16=False)
print(result["text"])
You can find your API key on https://replicate.com
(Whisper_api) prasun#prasun-Latitude-5400:~/Documents/Projects/whisper-main$ python3 Api.py
Sarted
Getting stuck with no output

Related

Having Problem in TensorFlow-Tutorials-Image segmentation

I'm using a jupyter notebook.
I followed the code below and entered it.
pip install git+https://github.com/tensorflow/examples.git
import tensorflow as tf
import tensorflow_datasets as tfds
from tensorflow_examples.models.pix2pix import pix2pix
from IPython.display import clear_output
import matplotlib.pyplot as plt
And I tried to "Download the Oxford-IIIT Pets dataset"
dataset, info = tfds.load('oxford_iiit_pet:3.*.*', with_info=True)
However, in the console, printed this
Downloading and preparing dataset Unknown size (download: Unknown size, generated: Unknown size, total: Unknown size) to ~\tensorflow_datasets\mnist\3.0.1...
and there was no data in the folder created.
Why isn't it working?
Tutorial link:https://www.tensorflow.org/tutorials/images/segmentation

only instance of a python 3.7 application run

I want to make my application by Python 3.7 run just in only one instance.
I have tried the code bellow codes but I didnt succed.
import psutil
import time
procs = [p for p in psutil.process_iter() if 'python.exe' in p.name() and __file__ in p.cmdline()]
if len(procs) > 1:
print('Process is already running...')
sys.exit(1)
for i in range(10):
print('Running...')
time.sleep(2)```

FreeCAD CMD color lost after import

Whenenver I try to import a model via FreeCADCmd Script the objects loose all color information.
This can be checked within the GUI by running macros
import FreeCAD
import ImportGui
doc = FreeCAD.newDocument()
FreeCAD.setActiveDocument(doc.Name)
ImportGui.insert("file1.stp", doc.Name)
will preserve the colors -- but can not be run on commandline, because of ImportGui.
import FreeCAD
import Import
doc = FreeCAD.newDocument()
FreeCAD.setActiveDocument(doc.Name)
Import.insert("file1.stp", doc.Name)
will import the model without any color information.
Is there any way to import a step file into FreeCADCmd (commandline -- so no GUI) without the color information being dropped?
Or does anyone know a way to run FreeCAD (GUI Version) without running a xserver?

How to import .py in google Colaboratory?

I want to simplify code. so i make a utils.py , but Google Colaboratory directory is "/content" I read other questions. but this is not my solution
In Google's Colab notebook, How do I call a function from a Python file?
%%writefile example.py
def f():
print 'This is a function defined in a Python source file.'
# Bring the file into the local Python environment.
execfile('example.py')
f()
This is a function defined in a Python source file.
It look likes just using def().
using this, i always write the code in cell.
but i want to this code
import example.py
example.f()
A sample maybe you want:
!wget https://raw.githubusercontent.com/tensorflow/models/master/samples/core/get_started/iris_data.py -P local_modules -nc
import sys
sys.path.append('local_modules')
import iris_data
iris_data.load_data()
I have also had this problem recently.
I addressed the issue by the following steps, though it's not a perfect solution.
src = list(files.upload().values())[0]
open('util.py','wb').write(src)
import util
This code should work with Python 3:
from google.colab import drive
import importlib.util
# Mount your drive. It will be at this path: "/content/gdrive/My Drive/"
drive.mount('/content/gdrive')
# Load your module
spec = importlib.util.spec_from_file_location("YOUR_MODULE_NAME", "/content/gdrive/My Drive/utils.py")
your_module_name = importlib.util.module_from_spec(spec)
spec.loader.exec_module(your_module_name)
import importlib.util
import sys
from google.colab import drive
drive.mount('/content/gdrive')
# To add a directory with your code into a list of directories
# which will be searched for packages
sys.path.append('/content/gdrive/My Drive/Colab Notebooks')
import example.py
This works for me.
Use this if you are out of content folder! hope this help!
import sys
sys.path.insert(0,'/content/my_project')
from example import*
STEP 1. I have just created a folder 'common_module' like shown in the image :
STEP 2 called the required Class from my "colab" code cell,
sys.path.append('/content/common_module/')
from DataPreProcessHelper import DataPreProcessHelper as DPPHelper
My class file 'DataPreProcessHelper.py' looks like this
Add path of 'sample.py' file to system paths as:
import sys
sys.path.append('drive/codes/')
import sample

import error: Django Running in terminal works but not in eclipse IDE

from django.http import HttpResponse
import urllib2
import simplejson
import memcache
def epghome(request):
mc=memcache.Client(['localhost:11211'])
if mc.get("jsondata"):
myval=mc.get("jsondata")
return HttpResponse("<h1>This Data is coming from Cache :</h1><br> " + str(myval))
else:
responseFromIDubba = ""
responseFromIDubba = urllib2.urlopen("http://www.idubba.com/apps/guide.aspx?key=4e2b0ca2328e03acce0014101d302ac7&type=1&f1=1&f2=0&channel=&gener=&page=0&summary=1").read()
parseResponseString = simplejson.loads(responseFromIDubba)
print(parseResponseString)
body=""
for data in parseResponseString["data"]:
#for keys in data:
#body=body+str(data .items())+".."+str(data[str(keys)])+"<br>"
body=body+str(data.items())+"<br><br>"
#body=body+"<br><br>"
mc.set("epgdata3",body)
mc.set("jsondata",responseFromIDubba)
returndata=str(mc.get("jsondata"))
return HttpResponse("<h1>No Cache Set</h1>" + responseFromIDubba)
Hi, This code is working if I run it in the terminal Python, without any error.
But in ECLIPSE IDE it always gives Import Error.
Even if I downloaded and install those modules. Also, and I restarted both Eclipse and my system, but it won't help.
Can you please suggest me a site where I get all libraries at once ?