Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
%%capture | |
!pip install gradio transformers sentencepiece | |
import gradio as gr | |
from transformers import pipeline | |
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es") | |
def predict(text): |
This file contains hidden or 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
""" Chrome Manifest file: https://developer.chrome.com/docs/extensions/mv3/getstarted/ | |
{ | |
"manifest_version": 3, | |
"name": "Hugging Face Question Generator", | |
"version": "1.0", | |
"description": "Generate questions based on selected text", | |
"permissions": [ | |
"contextMenus", | |
"storage", | |
"tabs", |
This file contains hidden or 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 os | |
import shutil | |
from huggingface_hub import Repository, HfApi, HfFolder | |
def get_model_card(lang): | |
model_card = """--- | |
tags: | |
- corenlp | |
library_tag: corenlp |
This file contains hidden or 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
/* | |
* Converts table from [[Header0, Header1, Header2], [Column0Val0, Column1Val0, Column2Val0], ...] | |
* to {Header0: [ColumnVal0, ...], Header1: [Column1Val0, ...], Header2: [Column2Val0, ...]} | |
*/ | |
function convertTableToData(table) { | |
transposed = table[0].map((_, colIndex) => table.map(row => row[colIndex])); | |
result = {} | |
for(var i = 0; i < transposed.length; i++) { | |
header = transposed[i][0] | |
result[header] = transposed[i].slice(1, 4).map(String); |