
Recherche avancée
Autres articles (73)
-
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)
Sur d’autres sites (8669)
-
How to write unit tests for your plugin – Introducing the Piwik Platform
17 novembre 2014, par Thomas Steur — DevelopmentThis is the next post of our blog series where we introduce the capabilities of the Piwik platform (our previous post was How to verify user permissions). This time you’ll learn how to write unit tests in Piwik. For this tutorial you will need to have basic knowledge of PHP, PHPUnit and the Piwik platform.
When is a test a unit test ?
There are many different opinions on this and it can be sometimes hard to decide. At Piwik we consider a test as a unit test if only a single method or class is being tested and if a test does not have a dependency to the filesystem, web, config, database or to any other plugin.
If a test is slow it can be an indicator that it is not a unit test. “Slow” is of course a bit vague. We will cover how to write other type of tests, such as integration tests, in one of our next blog posts.
Getting started
In this post, we assume that you have already installed Piwik 2.9.0 or later via git, set up your development environment and created a plugin. If not, visit the Piwik Developer Zone where you’ll find the tutorial Setting up Piwik and other Guides that help you to develop a plugin.
Let’s create a unit test
We start by using the Piwik Console to create a new unit test :
./console generate:test --testtype unit
The command will ask you to enter the name of the plugin the created test should belong to. I will use the plugin name “Insights”. Next it will ask you for the name of the test. Here you usually enter the name of the class you want to test. I will use “Widgets” in this example. There should now be a file
plugins/Insights/tests/Unit/WidgetsTest.php
which contains already an example to get you started easily :- /**
- * @group Insights
- * @group WidgetsTest
- * @group Plugins
- */
- class WidgetsTest extends \PHPUnit_Framework_TestCase
- {
- public function testSimpleAddition()
- {
- $this->assertEquals(2, 1+1);
- }
- }
We don’t want to cover how you should write your unit test. This is totally up to you. If you have no experience in writing unit tests yet, we recommend to read articles on the topic, or a book, or to watch videos or anything else that will help you learn best.
Running a test
To run a test we will use the command
tests:run
which allows you to execute a test suite, a specific file or a group of tests.To verify whether the created test works we will run it as follows :
./console tests:run WidgetsTest
This will run all tests having the group
WidgetsTest
. As other tests can use the same group you might want to pass the path to your test file instead :./console tests:run plugins/Insights/tests/Unit/Widgets.php
If you want to run all tests within your plugin pass the name of your plugin as an argument :
./console tests:run insights
Of course you can also define multiple arguments :
./console tests:run insights WidgetsTest
This will execute all tests within the insights plugin having the group WidgetsTest. If you only want to run unit tests within your plugin you can do the following :
./console tests:run insights unit
Advanced features
Isn’t it easy to create a unit test ? We never even created a file ! You can accomplish even more if you want : You can generate other type of tests, you can run tests on Amazon’s AWS and more. Unfortunately, not everything is documented yet so we recommend to discover more features by executing the commands
./console list tests
and./console help tests:run
.If you have any feedback regarding our APIs or our guides in the Developer Zone feel free to send it to us.
-
Easily track Events within Matomo Analytics thanks to Matomo Tag Manager
7 juin 2019, par Matomo Core Team — Analytics Tips -
OSError : [WinError 126] Não foi possível encontrar o módulo especificado. Error loading [closed]
27 août 2024, par FelipesInformações relevantes


**
SO : Windowns 11
Dependencias : torch —extra-index-url https://download.pytorch.org/whl/cpu ;
openai-whisper ;
ffmpeg-python
Microsoft Visual C++ Redistributable


Tudo isso dentro de um ambiente virtual
**


Então... eu to com o seguinte codigo em python :


import whisper
import os

# Carregar o modelo
model = whisper.load_model("base") # Pode usar 'small', 'medium', 'large' conforme a necessidade

# Carregar o áudio
audio_path = "audio.mp3" # Substitua pelo caminho do arquivo de áudio extraído
result = model.transcribe(audio_path)

# Obter o texto da transcrição
transcription_text = result['text']

# Salvar a transcrição em um arquivo .txt
with open("transcription.txt", "w") as file:
 file.write(transcription_text)

print("Transcrição salva em 'transcription.txt'")



Basicamente é pegar um arquivo .mp3 e salvar a transcrisão no em arquivo txt
mas ao rodar o codigo eu recebo o seguinte erro :


Traceback (most recent call last):
 File "C:\Users\Felipe Bezerra\Documents\ytDownload\transcrisao.py", line 2, in <module>
 import whisper
 File "C:\Users\Felipe Bezerra\Documents\ytDownload\venv\Lib\site-packages\whisper\__init__.py", line 8, in <module>
 import torch
 File "C:\Users\Felipe Bezerra\Documents\ytDownload\venv\Lib\site-packages\torch\__init__.py", line 148, in <module>
 raise err
OSError: [WinError 126] Não foi possível encontrar o módulo especificado. Error loading "C:\Users\Felipe Bezerra\Documents\ytDownload\venv\Lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies.
</module></module></module>


É como se as dependências não estivecem instaladas, já verifiquei a variavél de ambiente, criei outro ambiente virtual, e sempre caio nesse mesmo erro.


PS : o msm codigo rodou perfeitamente no Debian 12


Verifiquei o ambiente virtual, reistalei tudo