This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import transformers | |
from transformers import AutoTokenizer, AutoModelForCausalLM | |
model = "tiiuae/falcon-40b-instruct" | |
tokenizer = AutoTokenizer.from_pretrained(model, padding_side="left") | |
pipeline = transformers.pipeline( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
SOFTWARE. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import wraps, lru_cache | |
from contextlib import contextmanager | |
class _SkipCache(Exception): | |
def __init__(self, value): | |
self.value = value | |
class _CachedFunction(object): | |
def __init__(self, maxsize = 128, typed = False): | |
self.__is_skipped = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Horizontal layer | Examples | |
---|---|---|
Business logic | Application-specific logic, domain logic, validation rules | |
Persistence | WebStorage, IndexedDB, File System Access API, HTTP, WebSocket, GraphQL, Firebase, Meteor | |
Messaging | WebRTC, WebSocket, Push API, Server-Sent Events | |
I/O | Web Bluetooth, WebUSB, NFC, camera, microphone, proximity sensor, ambient light sensor | |
Presentation | DOM manipulation, event listeners, formatting | |
User interaction | UI behaviour, form validation | |
State management | Application state management, application-specific events |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to Fix it: | |
1. Remove wkhtmltopdf and related package | |
$ sudo apt-get remove libqt4-dev qt4-dev-tools wkhtmltopdf | |
$ sudo apt-get autoremove | |
2. Install requirement package for compiling | |
$ sudo apt-get install openssl build-essential libssl-dev libxrender-dev git-core libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
from weasyprint import HTML, CSS | |
def get_page_body(boxes): | |
for box in boxes: | |
if box.element_tag == 'body': | |
return box |