Explanation of a fullstack deployment of wagtail in a dockerized environment with Nginx, Elasticsearch, Postgres and Memcached
Required Skills:
- docker
- docker-compose
- get a local wagtail site running
from phonemizer.backend import EspeakBackend | |
backend = EspeakBackend('en-us', preserve_punctuation=True, with_stress=True) | |
text = ["Hello, world!", "Welcome to Medium!"] | |
phonemized = backend.phonemize(text, strip=True) | |
print(phonemized) |
#!/usr/bin/python | |
# -*- coding=utf-8 -*- | |
""" | |
An example of cleaning arabic text with PyArbic Library | |
Requirements: pip install pyarabic | |
Data: text file | |
Ouput: text file ( cleaned) | |
""" | |
import sys |
from sentence_transformers import SentenceTransformer, util | |
import torch | |
# save model in current directory | |
model = SentenceTransformer('paraphrase-multilingual-MiniLM-L12-v2', device='cpu', cache_folder='./') | |
# save model in models folder (you need to create the folder on your own beforehand) | |
# model = SentenceTransformer('paraphrase-multilingual-MiniLM-L12-v2', device='cpu', cache_folder='./models/') | |
# Corpus with example sentences | |
corpus = [ |
#pip install git+https://github.com/huggingface/transformers.git | |
import datetime | |
import sys | |
from transformers import pipeline | |
from transformers.pipelines.audio_utils import ffmpeg_microphone_live | |
pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base", device=0) | |
sampling_rate = pipe.feature_extractor.sampling_rate |
# coding=utf-8 | |
# Copyright 2023 The HuggingFace Inc. team. All rights reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
Apologies for the snarky title, but there has been a huge amount of discussion around so called "Prompt Engineering" these past few months on all kinds of platforms. Much of it is coming from individuals who are peddling around an awful lot of "Prompting" and very little "Engineering".
Most of these discussions are little more than users finding that writing more creative and complicated prompts can help them solve a task that a more simple prompt was unable to help with. I claim this is not Prompt Engineering. This is not to say that crafting good prompts is not a difficult task, but it does not involve doing any kind of sophisticated modifications to general "template" of a prompt.
Others, who I think do deserve to call themselves "Prompt Engineers" (and an awful lot more than that), have been writing about and utilizing the rich new eco-system
summary notes and more |